You are here

function openid_connect_generate_username in OpenID Connect / OAuth client 8

Same name and namespace in other branches
  1. 7 openid_connect.module \openid_connect_generate_username()

Generate a username for a new account.

Parameters

string $sub: The subject identifier.

array $userinfo: The user claims.

string $client_name: The client identifier.

Return value

string A unique username.

Deprecated

in openid_connect:8.x-1.0-beta6 and is removed from openid_connect:8.x-2.0. No replacement is intended. The new method Drupal\openid_connect\OpenIDConnect::generateUsername() or \Drupal::service('openid_connect.openid_connect')->generateUsername() will be set protected for the OpenID Connect service.

See also

https://www.drupal.org/project/openid_connect/issues/2961938

File

./openid_connect.module, line 300
Hook implementations of the OpenID Connect module.

Code

function openid_connect_generate_username($sub, array $userinfo, $client_name) {
  @trigger_error("openid_connect_generate_username() is deprecated in openid_connect:8.x-1.0-beta6 and is removed from openid_connect:8.x-2.0. No replacement is intended. The new method Drupal\\openid_connect\\OpenIDConnect::generateUsername() or \\Drupal::service('openid_connect.openid_connect')->generateUsername() will be set protected for the OpenID Connect service. See https://www.drupal.org/project/openid_connect/issues/2961938", E_USER_DEPRECATED);
  return \Drupal::service('openid_connect.openid_connect')
    ->generateUsername($sub, $userinfo, $client_name);
}