Railgun JWT

NotValidBeforeValidator extends TimeBasedValidator
in package

Provides a validator that checks whether the token may be used yet.

Table of Contents

Constants

CLAIM_IAT  = 'iat'
Name of "iat" (Issued At) claim.
CLAIM_NBF  = 'nbf'
Name of "nbf" (Not Before) claim.
CLAIMS  = [self::CLAIM_NBF, self::CLAIM_IAT]
Default value for the constructor $claims parameter.

Methods

__construct()  : mixed
validate()  : void
Validates the claims provided in a JWT.

Constants

CLAIMS

Default value for the constructor $claims parameter.

public array<string|int, string> CLAIMS = [self::CLAIM_NBF, self::CLAIM_IAT]

Methods

__construct()

public __construct([int $leeway = 0 ][, mixed $time = null ][, array<string|int, mixed> $claims = self::CLAIMS ]) : mixed
Parameters
$leeway : int = 0

Amount of leeway applied on the timestamp before comparing.

$time : mixed = null

Callable that return the current timestamp, will use PHP's time() if null.

$claims : array<string|int, mixed> = self::CLAIMS

validate()

Validates the claims provided in a JWT.

public validate(object $headers, object $payload) : void
Parameters
$headers : object

Headers section from the provided JWT.

$payload : object

Payload section from the provided JWT.

Tags
throws
NotValidYetException

If a token is not yet valid.


        
On this page

Search results