API - XOOPS 2.5.11 Beta 2
By monxoops.fr
TokenReader Class Reference

Static Public Member Functions

static fromString ($key, $token, $assertClaims=array())
 
static fromCookie ($key, $cookieName, $assertClaims=array())
 
static fromRequest ($key, $attributeName, $assertClaims=array())
 
static fromHeader ($key, $assertClaims=array(), $headerName='Authorization')
 

Member Function Documentation

◆ fromCookie()

static fromCookie (   $key,
  $cookieName,
  $assertClaims = array() 
)
static

Validate and decode a JSON Web Token string from a cookie

Parameters
KeyAbstract | string$keythe key to use to sign the token, or name of key to build
string$cookieNamename of cookie that sources the token
array | \Traversable$assertClaimstraversable set of claims, claim => value, to assert
Returns
\stdClass|false payload as stdClass, or false if token was invalid
Exceptions

InvalidArgumentException on unusable key name

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromHeader()

static fromHeader (   $key,
  $assertClaims = array(),
  $headerName = 'Authorization' 
)
static

Validate and decode a JSON Web Token string from a header

Parameters
KeyAbstract | string$keythe key to use to sign the token, or name of key to build
array | \Traversable$assertClaimstraversable set of claims, claim => value, to assert
string$headerNamename of header that sources the token
Returns
\stdClass|false payload as stdClass, or false if token was invalid
Exceptions

InvalidArgumentException on unusable key name

Here is the call graph for this function:

◆ fromRequest()

static fromRequest (   $key,
  $attributeName,
  $assertClaims = array() 
)
static

Validate and decode a JSON Web Token string from a request (i.e. POST body)

Parameters
KeyAbstract | string$keythe key to use to sign the token, or name of key to build
string$attributeNamename of cookie that sources the token
array | \Traversable$assertClaimstraversable set of claims, claim => value, to assert
Returns
\stdClass|false payload as stdClass, or false if token was invalid
Exceptions

InvalidArgumentException on unusable key name

Here is the call graph for this function:

◆ fromString()

static fromString (   $key,
  $token,
  $assertClaims = array() 
)
static

Validate and decode a JSON Web Token string

Parameters
KeyAbstract | string$keythe key to use to sign the token, or name of key to build
string$tokenthe token string to validate and decode
array | \Traversable$assertClaimstraversable set of claims, claim => value, to assert
Returns
\stdClass|false payload as stdClass, or false if token was invalid
Exceptions

InvalidArgumentException on unusable key name

Here is the call graph for this function:

The documentation for this class was generated from the following file: