public function OpenIDConnectClientBase::decodeIdToken in OpenID Connect / OAuth client 7
Decodes ID token to access user data.
Parameters
string $id_token: The encoded ID token containing the user data.
Return value
array User identity information.
Overrides OpenIDConnectClientInterface::decodeIdToken
File
- includes/
OpenIDConnectClientBase.class.php, line 176 - Base class for OpenID Connect clients.
Class
- OpenIDConnectClientBase
- Base class for OpenID Connect clients.
Code
public function decodeIdToken($id_token) {
list($headerb64, $claims64, $signatureb64) = explode('.', $id_token);
$claims64 = str_replace(array(
'-',
'_',
), array(
'+',
'/',
), $claims64);
$claims64 = base64_decode($claims64);
return drupal_json_decode($claims64);
}