/**
  * Credentials should be in array format with keys: token and username.
  * Example: ['username' => '*****@*****.**', 'password' => '123abc'].
  *
  * {@inheritdoc}
  */
 public function verifyCredentials(array $credentials)
 {
     $this->verifyRequiredFields($credentials, ['username', 'password']);
     $user = $this->user_repository->findByUsername($credentials['username']);
     $this->verifyUser($user, $credentials['password']);
     return $user;
 }
 /**
  * {@inheritdoc}
  */
 public function verifyCredentials(array $payload)
 {
     if (!isset($payload['username'])) {
         throw new InvalidCredentialsException();
     }
     $user = $this->user_repository->findByUsername($payload['username']);
     if (!$user) {
         throw new UserNotFoundException();
     }
     return $user;
 }
Beispiel #3
0
 /**
  * {@inheritdoc}
  */
 public function getAuthenticatedUser(UserRepositoryInterface $repository)
 {
     return $repository->findByUsername($this->user_id);
 }