You are here

function hook_openid_connect_post_authorize in OpenID Connect / OAuth client 8

Same name and namespace in other branches
  1. 7 openid_connect.api.php \hook_openid_connect_post_authorize()
  2. 2.x openid_connect.api.php \hook_openid_connect_post_authorize()

OpenID Connect post authorize hook.

This hook runs after a user has been authorized and claims have been mapped to the user's account.

A popular use case for this hook is to saving token and additional identity provider related information to the user's Drupal session (private temp store).

Parameters

\Drupal\user\UserInterface $account: User account object of the authorized user.

array $context: An associative array with context information:

  • tokens: An array of tokens.
  • user_data: An array of user and session data.
  • userinfo: An array of user information.
  • plugin_id: The plugin identifier.
  • sub: The remote user identifier.
2 invocations of hook_openid_connect_post_authorize()
OpenIDConnect::completeAuthorization in src/OpenIDConnect.php
Complete the authorization after tokens have been retrieved.
OpenIDConnect::connectCurrentUser in src/OpenIDConnect.php
Connect the current user's account to an external provider.

File

./openid_connect.api.php, line 183
Documentation for OpenID Connect module APIs.

Code

function hook_openid_connect_post_authorize(UserInterface $account, array $context) {
}