public function UserRepository::getUserEntityByUserCredentials in Simple OAuth (OAuth2) & OpenID Connect 8.2
Same name and namespace in other branches
- 8.4 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 30
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;
}
return NULL;
}