class IdToken

This class represents an ID Token.

The ID Token, a JSON Web Token (JWT), contains user profile information (including items such as the user's ID, user's name and email) which is represented in the form of claims. These claims are statements about the user.

Constants

CLAIMS

Properties

protected string $idToken
protected array $claims

Methods

__construct(string $idToken)

Constructs an IdToken instance from an undecoded ID token string

string
get()

Returns the undecoded ID Token

string
getIss()

Returns the Issuer Identifier of the issuer of the response.

string
getSub()

Returns the Subject Identifier.

string|array
getAud()

Returns the audience(s) that this ID Token is intended for.

string
getExp()

Returns the expiration time on or after which the ID Token MUST NOT be accepted for processing.

string
getIat()

Returns the time at which the JWT was issued.

string
getAuthTime()

Returns the time when the End-User authentication occurred.

string
getNonce()

Returns the value used to associate a Client session with an ID Token, and to mitigate replay attacks.

string
getAcr()

Returns the Authentication Context Class Reference.

array
getAmr()

Returns the Authentication Methods References.

string
getAzp()

Returns the Authorized party - the party to which the ID Token was issued.

string
getAtHash()

Returns the hash of the OAuth2 access token when used with Implicit profile.

string
getCHash()

Returns the hash of the OAuth2 authorization code when used with the hybrid profile.

string|array
getClaim(string $claim)

Returns the value of specified claim

array
getClaims()

Returns the array of claims

string
__toString()

Returns the undecoded ID Token

array
toArray()

Returns an array containing the claims and the undecoded ID Token

Details

at line 47
__construct(string $idToken)

Constructs an IdToken instance from an undecoded ID token string

Parameters

string $idToken the undecoded ID token string

at line 64
string get()

Returns the undecoded ID Token

Return Value

string

at line 75
string getIss()

Returns the Issuer Identifier of the issuer of the response.

The iss value is a case sensitive URL using the https scheme.

Return Value

string

at line 87
string getSub()

Returns the Subject Identifier.

This is a locally unique and never reassigned identifier within the Issuer for the End-User, which is intended to be consumed by the Client

Return Value

string

at line 100
string|array getAud()

Returns the audience(s) that this ID Token is intended for.

In the general case, the aud value is an array of case sensitive strings. In the common special case when there is one audience, the aud value may be a single case sensitive string.

Return Value

string|array

at line 109
string getExp()

Returns the expiration time on or after which the ID Token MUST NOT be accepted for processing.

Return Value

string

at line 118
string getIat()

Returns the time at which the JWT was issued.

Return Value

string

at line 127
string getAuthTime()

Returns the time when the End-User authentication occurred.

Return Value

string

at line 137
string getNonce()

Returns the value used to associate a Client session with an ID Token, and to mitigate replay attacks.

Return Value

string

at line 146
string getAcr()

Returns the Authentication Context Class Reference.

Return Value

string

at line 155
array getAmr()

Returns the Authentication Methods References.

Return Value

array

at line 164
string getAzp()

Returns the Authorized party - the party to which the ID Token was issued.

Return Value

string

at line 173
string getAtHash()

Returns the hash of the OAuth2 access token when used with Implicit profile.

Return Value

string

at line 182
string getCHash()

Returns the hash of the OAuth2 authorization code when used with the hybrid profile.

Return Value

string

at line 192
string|array getClaim(string $claim)

Returns the value of specified claim

Parameters

string $claim the name of the claim

Return Value

string|array the value of the claim

at line 201
array getClaims()

Returns the array of claims

Return Value

array

at line 212
string __toString()

Returns the undecoded ID Token

Alias of the get method

Return Value

string

at line 223
array toArray()

Returns an array containing the claims and the undecoded ID Token

Alias of the getClaims method

Return Value

array