You are here

function hook_openid_connect_post_authorize in OpenID Connect / OAuth client 7

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

Perform an action after a successful authorization.

Parameters

array $tokens: ID token and access token that we received as a result of the OpenID Connect flow.

object $account: The user account that has just been logged in.

array $userinfo: The user claims returned by the OpenID Connect provider.

string $client_name: The machine name of the OpenID Connect client plugin.

bool $is_new: Whether the account has just been created via OpenID Connect.

2 invocations of hook_openid_connect_post_authorize()
openid_connect_complete_authorization in ./openid_connect.module
Complete the authorization after tokens have been retrieved.
openid_connect_connect_current_user in ./openid_connect.module
Connect the current user's account to an external provider.

File

./openid_connect.api.php, line 55
Hooks provided by the OpenID Connect module.

Code

function hook_openid_connect_post_authorize(array $tokens, $account, array $userinfo, $client_name, $is_new) {
  drupal_set_message($is_new ? t('Welcome!') : t('Welcome back!'));
}