From a7a187cf53edac1f0f90dc3767e225f26b508e09 Mon Sep 17 00:00:00 2001 From: "T.Saisyo" Date: Sun, 28 Jul 2019 17:11:21 +0900 Subject: [PATCH] =?UTF-8?q?=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=82=80=E3=83=89?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=90=E3=82=92=E5=8F=AF=E5=A4=89=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 2 +- src/Grant/PasswordGrant.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index cb54606c3..8a17e4f7f 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/src/Grant/PasswordGrant.php b/src/Grant/PasswordGrant.php index cb53ccd8b..951507e7b 100644 --- a/src/Grant/PasswordGrant.php +++ b/src/Grant/PasswordGrant.php @@ -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));