You are here

function hook_oauth2_server_user_claims_alter in OAuth2 Server 8

Same name and namespace in other branches
  1. 7 oauth2_server.api.php \hook_oauth2_server_user_claims_alter()
  2. 2.0.x oauth2_server.api.php \hook_oauth2_server_user_claims_alter()

Perform alterations on the available claims.

Parameters

array[] $context: Array of claims, account and requested scopes.

1 function implements hook_oauth2_server_user_claims_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

oauth2_server_test_oauth2_server_user_claims_alter in tests/modules/oauth2_server_test/oauth2_server_test.module
Implements hook_oauth2_server_user_claims_alter().
1 invocation of hook_oauth2_server_user_claims_alter()
OAuth2Storage::getUserClaims in src/OAuth2Storage.php
Get user claims.

File

./oauth2_server.api.php, line 45
OAuth2 Server API documentation.

Code

function hook_oauth2_server_user_claims_alter(array &$context) {
  if (in_array('phone', $context['requested_scopes'])) {
    $context['claims']['phone_number'] = '123456';
    $context['claims']['phone_number_verified'] = FALSE;
  }
}