Skip to content

Commit

Permalink
読み込むドライバを可変に
Browse files Browse the repository at this point in the history
  • Loading branch information
attoiuma committed Jul 28, 2019
1 parent 2eb1cf7 commit a7a187c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "league/oauth2-server",
"name": "attoiuma/oauth2-server",
"description": "A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.",
"homepage": "https://oauth2.thephpleague.com/",
"license": "MIT",
Expand Down
10 changes: 8 additions & 2 deletions src/Grant/PasswordGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,17 @@ protected function validateUser(ServerRequestInterface $request, ClientEntityInt
throw OAuthServerException::invalidRequest('password');
}

$user = $this->userRepository->getUserEntityByUserCredentials(
$provider = $this->getRequestParameter('provider', $request);
if (is_null($provider)) {
throw OAuthServerException::invalidRequest('provider');
}

$user = $this->userRepository->getEntityByUserCredentials(
$username,
$password,
$this->getIdentifier(),
$client
$client,
$provider
);
if ($user instanceof UserEntityInterface === false) {
$this->getEmitter()->emit(new RequestEvent(RequestEvent::USER_AUTHENTICATION_FAILED, $request));
Expand Down

0 comments on commit a7a187c

Please sign in to comment.