TokenRequest
in package
Generates the Token Request
Table of Contents
- __construct() : TokenRequest
- creates a new TokenRequest instance
- getAccessToken() : string
- retrieves the access_token returned from previous token request
- getIdToken() : string
- retrieves the id_token returned from previous token request
- getResponse() : object
- retrieves the response returned from previous token request
- send() : object
- send the token request
Methods
__construct()
creates a new TokenRequest instance
public
__construct(array<string|int, mixed> $config[, array<string|int, mixed> $hooks = null ]) : TokenRequest
Parameters
- $config : array<string|int, mixed>
-
base configuration
- $hooks : array<string|int, mixed> = null
-
hooks defined list
Tags
Return values
TokenRequest —getAccessToken()
retrieves the access_token returned from previous token request
public
getAccessToken() : string
Tags
Return values
string —access_token returned from token request
getIdToken()
retrieves the id_token returned from previous token request
public
getIdToken() : string
Tags
Return values
string —id_token returned from token request
getResponse()
retrieves the response returned from previous token request
public
getResponse() : object
Tags
Return values
object —response returned from token request
send()
send the token request
public
send(string $token_endpoint, string $auth_code, string $code_verifier[, bool $refresh = false ][, string $refresh_token = null ]) : object
Parameters
- $token_endpoint : string
-
token endpoint of the provider
- $auth_code : string
-
value of authorization_code obtained from authentication request
- $code_verifier : string
-
value of code_verifier whose related code_challenge was sent with authentication request
- $refresh : bool = false
-
if true send a token request with a refresh token for obtain a new access token
- $refresh_token : string = null
-
value of refresh token
Tags
Return values
object —response returned from token request