Auth0-PHP

ValidatorInterface
in

Interface ValidatorInterface.

Table of Contents

audience()  : self
Validate the 'aud' claim.
authorizedParty()  : self
Validate the 'azp' claim.
authTime()  : self
Validate the 'auth_time' claim.
expiration()  : self
Validate the 'exp' claim.
issued()  : self
Validate the 'iat' claim is present.
issuer()  : self
Validate the 'iss' claim.
nonce()  : self
Validate the 'nonce' claim.
organization()  : self
Validate the 'org_id' claim.
subject()  : self
Validate the 'sub' claim is present.

Methods

audience()

Validate the 'aud' claim.

public audience(array<string|int, string> $expects) : self
Parameters
$expects : array<string|int, string>

An array of allowed values for the 'aud' claim. Successful if ANY match.

Tags
throws
InvalidTokenException

when claim validation fails

Return values
self

authorizedParty()

Validate the 'azp' claim.

public authorizedParty(array<string|int, string> $expects) : self
Parameters
$expects : array<string|int, string>

An array of allowed values for the 'azp' claim. Successful if ANY match.

Tags
throws
InvalidTokenException

when claim validation fails

Return values
self

authTime()

Validate the 'auth_time' claim.

public authTime(int $maxAge[, int $leeway = 60 ][, int|null $now = null ]) : self
Parameters
$maxAge : int

maximum window of time in seconds since the 'auth_time' to accept the token

$leeway : int = 60

leeway in seconds to allow during time calculations

$now : int|null = null

Optional. Unix timestamp representing the current point in time to use for time calculations.

Tags
throws
InvalidTokenException

when claim validation fails

Return values
self

expiration()

Validate the 'exp' claim.

public expiration([int $leeway = 60 ][, int|null $now = null ]) : self
Parameters
$leeway : int = 60

leeway in seconds to allow during time calculations

$now : int|null = null

Optional. Unix timestamp representing the current point in time to use for time calculations.

Tags
throws
InvalidTokenException

when claim validation fails

Return values
self

issuer()

Validate the 'iss' claim.

public issuer(string $expects) : self
Parameters
$expects : string

the value to compare with the claim

Tags
throws
InvalidTokenException

when claim validation fails

Return values
self

nonce()

Validate the 'nonce' claim.

public nonce(string $expects) : self
Parameters
$expects : string

the value to compare with the claim

Tags
throws
InvalidTokenException

when claim validation fails

Return values
self

organization()

Validate the 'org_id' claim.

public organization(array<string|int, string> $expects) : self
Parameters
$expects : array<string|int, string>

An array of allowed values for the 'org_id' claim. Successful if ANY match.

Tags
throws
InvalidTokenException

when claim validation fails

Return values
self

Search results