public function UserRepository::getUserEntityByUserCredentials in Simple OAuth (OAuth2) & OpenID Connect 8.4
Same name and namespace in other branches
- 8.2 src/Repositories/UserRepository.php \Drupal\simple_oauth\Repositories\UserRepository::getUserEntityByUserCredentials()
- 8.3 src/Repositories/UserRepository.php \Drupal\simple_oauth\Repositories\UserRepository::getUserEntityByUserCredentials()
- 5.x src/Repositories/UserRepository.php \Drupal\simple_oauth\Repositories\UserRepository::getUserEntityByUserCredentials()
File
- src/
Repositories/ UserRepository.php, line 31
Class
Namespace
Drupal\simple_oauth\RepositoriesCode
public function getUserEntityByUserCredentials($username, $password, $grantType, ClientEntityInterface $clientEntity) {
// TODO: Use authenticateWithFloodProtection when #2825084 lands.
if ($uid = $this->userAuth
->authenticate($username, $password)) {
$user = new UserEntity();
$user
->setIdentifier($uid);
return $user;
}
throw OAuthServerException::invalidCredentials();
}