You are here

public function TokenAuthUser::getUsername in Simple OAuth (OAuth2) & OpenID Connect 8.4

Same name and namespace in other branches
  1. 8 src/Authentication/TokenAuthUser.php \Drupal\simple_oauth\Authentication\TokenAuthUser::getUsername()
  2. 8.2 src/Authentication/TokenAuthUser.php \Drupal\simple_oauth\Authentication\TokenAuthUser::getUsername()
  3. 8.3 src/Authentication/TokenAuthUser.php \Drupal\simple_oauth\Authentication\TokenAuthUser::getUsername()
  4. 5.x src/Authentication/TokenAuthUser.php \Drupal\simple_oauth\Authentication\TokenAuthUser::getUsername()

Returns the unaltered login name of this account.

Return value

string An unsanitized plain-text string with the name of this account that is used to log in. Only display this name to admins and to the user who owns this account, and only in the context of the name used to log in. For any other display purposes, use \Drupal\Core\Session\AccountInterface::getDisplayName() instead.

Overrides AccountInterface::getUsername

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Session\AccountInterface::getAccountName() or \Drupal\user\UserInterface::getDisplayName() instead.

See also

https://www.drupal.org/node/2572493

File

src/Authentication/TokenAuthUser.php, line 153

Class

TokenAuthUser
The decorated user class with token information.

Namespace

Drupal\simple_oauth\Authentication

Code

public function getUsername() {
  return $this->subject
    ->getUsername();
}