Overview

Namespaces

  • Composer
    • Autoload
  • Geekwright
    • RegDom
  • League
    • OAuth2
      • Client
        • Provider
  • None
  • Xmf
    • Database
    • Jwt
    • Key
    • Module
      • Helper

Classes

  • JsonWebToken
  • KeyFactory
  • TokenFactory
  • TokenReader
  • Overview
  • Namespace
  • Class
  • Tree

Class JsonWebToken

Basic JSON Web Token support

Namespace: Xmf\Jwt
Package: Xmf
Category: Xmf\Jwt\JsonWebToken
Copyright: 2016 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: Richard Griffith richard@geekwright.com
Link: http://xoops.org
Located at lass/libraries/vendor/xoops/xmf/src/Xmf/Jwt/JsonWebToken.php
Methods summary
public
# __construct( Xmf\Key\KeyAbstract $key, string $algorithm = 'HS256' )

JsonWebToken constructor.

JsonWebToken constructor.

Parameters

$key
key for signing/validating
$algorithm
algorithm to use for signing/validating
public Xmf\Jwt\JsonWebToken
# setAlgorithm( string $algorithm )

Parameters

$algorithm
algorithm to use for signing/validating

Returns

Xmf\Jwt\JsonWebToken

Throws

DomainException
public object|false
# decode( string $jwtString, array|Traversable $assertClaims = array() )

Decode a JWT string, validating signature and well defined registered claims, and optionally validate against a list of supplied claims

Decode a JWT string, validating signature and well defined registered claims, and optionally validate against a list of supplied claims

Parameters

$jwtString
string containing the JWT to decode
$assertClaims
associative array, claim => value, of claims to assert

Returns

object|false
public string
# create( array|ArrayObject $payload, integer $expirationOffset = 0 )

Create a signed token string for a payload

Create a signed token string for a payload

Parameters

$payload
traversable set of claims, claim => value
$expirationOffset

seconds from now that token will expire. If not specified, an "exp" claim will not be added or updated

Returns

string
encoded and signed jwt string

Throws

DomainException;
InvalidArgumentException;
UnexpectedValueException;
Properties summary
protected Xmf\Key\KeyAbstract $key
#
protected string $algorithm
# 'HS256'
protected array $claims
# array()
API documentation generated by ApiGen