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 TokenReader

Validate and get payload from a token string

Namespace: Xmf\Jwt
Package: Xmf
Category: Xmf\Jwt\TokenReader
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/TokenReader.php
Methods summary
public static object|false
# fromString( string $keyName, string $token, array|Traversable $assertClaims = array() )

Validate and decode a JSON Web Token string

Validate and decode a JSON Web Token string

Parameters

$keyName
name of the key to used to sign the token
$token
the token string to validate and decode
$assertClaims
traversable set of claims, claim => value, to assert

Returns

object|false
payload as stdClass, or false if token was invalid
public static object|false
# fromCookie( string $keyName, string $cookieName, array|Traversable $assertClaims = array() )

Validate and decode a JSON Web Token string from a cookie

Validate and decode a JSON Web Token string from a cookie

Parameters

$keyName
name of the key to used to sign the token
$cookieName
name of cookie that sources the token
$assertClaims
traversable set of claims, claim => value, to assert

Returns

object|false
payload as stdClass, or false if token was invalid
public static object|false
# fromRequest( string $keyName, string $attributeName, array|Traversable $assertClaims = array() )

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

$keyName
name of the key to used to sign the token
$attributeName
name of cookie that sources the token
$assertClaims
traversable set of claims, claim => value, to assert

Returns

object|false
payload as stdClass, or false if token was invalid
public static object|false
# fromHeader( string $keyName, array|Traversable $assertClaims = array(), string $headerName = 'Authorization' )

Validate and decode a JSON Web Token string from a header

Validate and decode a JSON Web Token string from a header

Parameters

$keyName
name of the key to used to sign the token
$assertClaims
traversable set of claims, claim => value, to assert
$headerName
name of header that sources the token

Returns

object|false
payload as stdClass, or false if token was invalid
API documentation generated by ApiGen