You are here

public function OAuth2Storage::getUserDetails in OAuth2 Server 8

Same name and namespace in other branches
  1. 2.0.x src/OAuth2Storage.php \Drupal\oauth2_server\OAuth2Storage::getUserDetails()

Get user details.

Parameters

string $username: The username string.

Return value

array|bool The user details array or false.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/OAuth2Storage.php, line 710

Class

OAuth2Storage
Provides Drupal OAuth2 storage for the library.

Namespace

Drupal\oauth2_server

Code

public function getUserDetails($username) {
  $account = $this
    ->getStorageAccount($username);
  if ($account) {
    return [
      'user_id' => $account
        ->id(),
    ];
  }
  return FALSE;
}