mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 03:53:13 +00:00
Fix #1670 API password grant type authentication is broken
This commit is contained in:
@@ -798,7 +798,7 @@ class API_OAuth2_Adapter extends OAuth2
|
|||||||
protected function checkUserCredentials($client_id, $username, $password)
|
protected function checkUserCredentials($client_id, $username, $password)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$application = API_OAuth2_Application::load_from_client_id($this->app, $client_id);
|
$this->setClient(API_OAuth2_Application::load_from_client_id($this->app, $client_id));
|
||||||
|
|
||||||
$usr_id = $this->app['auth.native']->getUsrId($username, $password, Request::createFromGlobals());
|
$usr_id = $this->app['auth.native']->getUsrId($username, $password, Request::createFromGlobals());
|
||||||
|
|
||||||
@@ -806,13 +806,11 @@ class API_OAuth2_Adapter extends OAuth2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = \User_Adapter::getInstance($usr_id, $this->app);
|
$account = $this->updateAccount($usr_id);
|
||||||
|
|
||||||
$account = API_OAuth2_Account::load_with_user($this->app, $application, $user);
|
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'redirect_uri' => $application->get_redirect_uri()
|
'redirect_uri' => $this->client->get_redirect_uri()
|
||||||
, 'client_id' => $application->get_client_id()
|
, 'client_id' => $this->client->get_client_id()
|
||||||
, 'account_id' => $account->get_id()
|
, 'account_id' => $account->get_id()
|
||||||
);
|
);
|
||||||
} catch (AccountLockedException $e) {
|
} catch (AccountLockedException $e) {
|
||||||
|
Reference in New Issue
Block a user