TokenInterface
in
Tags
Table of Contents
Methods
- getAudience() : null|array<string|int, string>
- Get the contents of the 'aud' claim, always returned an array. Null if not present.
- getAuthorizedParty() : string|null
- Get the contents of the 'azp' claim. Null if not present.
- getAuthTime() : int|null
- Get the contents of the 'auth_time' claim. Null if not present.
- getEvents() : null|array<string|int, mixed>
- Get the contents of the 'events' claim. Null if not present.
- getExpiration() : int|null
- Get the contents of the 'exp' claim. Null if not present.
- getIdentifier() : string|null
- Get the contents of the 'sid' claim. Null if not present.
- getIssued() : int|null
- Get the contents of the 'iat' claim. Null if not present.
- getIssuer() : string|null
- Get the contents of the 'iss' claim. Null if not present.
- getNonce() : string|null
- Get the contents of the 'nonce' claim. Null if not present.
- getOrganization() : string|null
- Get the contents of the 'org_id' claim. Null if not present.
- getSubject() : string|null
- Get the contents of the 'sub' claim. Null if not present.
- parse() : self
- Parses a provided JWT string and prepare for verification and validation.
- toArray() : array<string|int, mixed>
- Export the state of the Token object as a PHP array.
- toJson() : string
- Export a JSON encoded object (as a string) representing the state of the Token object. Note that this is not itself an ID Token, but is useful for debugging your user state.
- validate() : self
- Validate the claims of the token.
- verify() : self
- Verify the signature of the Token using either RS256 or HS256.
Methods
getAudience()
Get the contents of the 'aud' claim, always returned an array. Null if not present.
public
getAudience() : null|array<string|int, string>
Return values
null|array<string|int, string>getAuthorizedParty()
Get the contents of the 'azp' claim. Null if not present.
public
getAuthorizedParty() : string|null
Return values
string|nullgetAuthTime()
Get the contents of the 'auth_time' claim. Null if not present.
public
getAuthTime() : int|null
Return values
int|nullgetEvents()
Get the contents of the 'events' claim. Null if not present.
public
getEvents() : null|array<string|int, mixed>
Return values
null|array<string|int, mixed>getExpiration()
Get the contents of the 'exp' claim. Null if not present.
public
getExpiration() : int|null
Return values
int|nullgetIdentifier()
Get the contents of the 'sid' claim. Null if not present.
public
getIdentifier() : string|null
Return values
string|nullgetIssued()
Get the contents of the 'iat' claim. Null if not present.
public
getIssued() : int|null
Return values
int|nullgetIssuer()
Get the contents of the 'iss' claim. Null if not present.
public
getIssuer() : string|null
Return values
string|nullgetNonce()
Get the contents of the 'nonce' claim. Null if not present.
public
getNonce() : string|null
Return values
string|nullgetOrganization()
Get the contents of the 'org_id' claim. Null if not present.
public
getOrganization() : string|null
Return values
string|nullgetSubject()
Get the contents of the 'sub' claim. Null if not present.
public
getSubject() : string|null
Return values
string|nullparse()
Parses a provided JWT string and prepare for verification and validation.
public
parse() : self
Tags
Return values
selftoArray()
Export the state of the Token object as a PHP array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toJson()
Export a JSON encoded object (as a string) representing the state of the Token object. Note that this is not itself an ID Token, but is useful for debugging your user state.
public
toJson() : string
Return values
stringvalidate()
Validate the claims of the token.
public
validate([null|string $tokenIssuer = null ][, null|array<string|int, string> $tokenAudience = null ][, null|array<string|int, string> $tokenOrganization = null ][, null|string $tokenNonce = null ][, null|int $tokenMaxAge = null ][, null|int $tokenLeeway = null ][, null|int $tokenNow = null ]) : self
Parameters
- $tokenIssuer : null|string = null
-
Optional. The value expected for the 'iss' claim.
- $tokenAudience : null|array<string|int, string> = null
-
Optional. An array of allowed values for the 'aud' claim. Successful if ANY match.
- $tokenOrganization : null|array<string|int, string> = null
-
Optional. An array of allowed values for the 'org_id' claim. Successful if ANY match.
- $tokenNonce : null|string = null
-
Optional. The value expected for the 'nonce' claim.
- $tokenMaxAge : null|int = null
-
Optional. Maximum window of time in seconds since the 'auth_time' to accept the token.
- $tokenLeeway : null|int = null
-
Optional. Leeway in seconds to allow during time calculations. Defaults to 60.
- $tokenNow : null|int = null
-
Optional. Unix timestamp representing the current point in time to use for time calculations.
Tags
Return values
selfverify()
Verify the signature of the Token using either RS256 or HS256.
public
verify([null|string $tokenAlgorithm = null ][, null|string $tokenJwksUri = null ][, null|string $clientSecret = null ][, null|int $tokenCacheTtl = null ][, null|CacheItemPoolInterface $tokenCache = null ]) : self
Parameters
- $tokenAlgorithm : null|string = null
-
Optional. Algorithm to use for verification. Expects either RS256 or HS256.
- $tokenJwksUri : null|string = null
-
Optional. URI to the JWKS when verifying RS256 tokens.
- $clientSecret : null|string = null
-
Optional. Client Secret found in the Application settings for verifying HS256 tokens.
- $tokenCacheTtl : null|int = null
-
Optional. Time in seconds to keep JWKS records cached.
- $tokenCache : null|CacheItemPoolInterface = null
-
Optional. A PSR-6 CacheItemPoolInterface instance to cache JWKS results within.