You are here

public function OpenIDConnectClientInterface::retrieveTokens in OpenID Connect / OAuth client 7

Retrieve access token and ID token.

Exchanging the authorization code that is received as the result of the authentication request for an access token and an ID token.

The ID token is a cryptographically signed JSON object encoded in base64. It contains identity information about the user. The access token can be sent to the login provider to obtain user profile information.

Parameters

string $authorization_code: Authorization code received as a result of the the authorization request.

Return value

array|false FALSE on failure, or an associative array containing:

  • id_token: The ID token that holds user data.
  • access_token: Access token that can be used to obtain user profile information.
  • expire: Unix timestamp of the expiration date of the access token.
1 method overrides OpenIDConnectClientInterface::retrieveTokens()
OpenIDConnectClientBase::retrieveTokens in includes/OpenIDConnectClientBase.class.php
Retrieve access token and ID token.

File

includes/OpenIDConnectClientInterface.class.php, line 113
Interface to implement OpenID Connect clients.

Class

OpenIDConnectClientInterface
Interface of the OpenID Connect client.

Code

public function retrieveTokens($authorization_code);