You are here

public function ExternalAuthInterface::register in External Authentication 8

Same name and namespace in other branches
  1. 2.0.x src/ExternalAuthInterface.php \Drupal\externalauth\ExternalAuthInterface::register()

Register a Drupal user based on an external authname.

The Drupal username of the account to be created defaults to the external authentication name prefixed with the provider ID. The caller may enforce a custom Drupal username by setting that value in $account_data['name'].

Parameters

string $authname: The unique, external authentication name provided by authentication provider.

string $provider: The module providing external authentication.

array $account_data: An array of additional properties to be saved with the user entity. If the array contains a 'name' string value, it will be used as local Drupal username, otherwise a default local Drupal username will be computed as "{$provider}_{$authname}".

mixed $authmap_data: Additional data to be stored in the authmap entry.

Return value

\Drupal\user\UserInterface The registered Drupal user.

1 method overrides ExternalAuthInterface::register()
ExternalAuth::register in src/ExternalAuth.php
Register a Drupal user based on an external authname.

File

src/ExternalAuthInterface.php, line 67

Class

ExternalAuthInterface
Interface ExternalAuthInterface.

Namespace

Drupal\externalauth

Code

public function register($authname, $provider, array $account_data = [], $authmap_data = NULL);