Methods |
public
static
|
fromString(KeyAbstract|string $key, string $token, array|Traversable $assertClaims = []): stdClass|false
Validate and decode a JSON Web Token string
Validate and decode a JSON Web Token string
Parameters
$key |
the key to use to sign the token, or name of key to build
|
$token |
the token string to validate and decode
|
$assertClaims |
traversable set of claims, claim => value, to assert
|
Returns
payload as stdClass, or false if token was invalid
Throws
|
#
|
public
static
|
fromCookie(KeyAbstract|string $key, string $cookieName, array|Traversable $assertClaims = []): stdClass|false
Validate and decode a JSON Web Token string from a cookie
Validate and decode a JSON Web Token string from a cookie
Parameters
$key |
the key to use to sign the token, or name of key to build
|
$cookieName |
name of cookie that sources the token
|
$assertClaims |
traversable set of claims, claim => value, to assert
|
Returns
payload as stdClass, or false if token was invalid
Throws
|
#
|
public
static
|
fromRequest(KeyAbstract|string $key, string $attributeName, array|Traversable $assertClaims = []): stdClass|false
Validate and decode a JSON Web Token string from a request (i.e. POST body)
Validate and decode a JSON Web Token string from a request (i.e. POST body)
Parameters
$key |
the key to use to sign the token, or name of key to build
|
$attributeName |
name of cookie that sources the token
|
$assertClaims |
traversable set of claims, claim => value, to assert
|
Returns
payload as stdClass, or false if token was invalid
Throws
|
#
|
public
static
|
fromHeader(
KeyAbstract|string $key,
array|Traversable $assertClaims = [],
string $headerName = 'Authorization',
): stdClass|false
Validate and decode a JSON Web Token string from a header
Validate and decode a JSON Web Token string from a header
Parameters
$key |
the key to use to sign the token, or name of key to build
|
$assertClaims |
traversable set of claims, claim => value, to assert
|
$headerName |
name of header that sources the token
|
Returns
payload as stdClass, or false if token was invalid
Throws
|
#
|