mirror of
https://github.com/salesagility/SuiteCRM.git
synced 2025-01-10 11:37:53 +00:00
Fix #10268 - Access token wil not refresh for Oauth2 password clients
Kudos: Scott Miller @scottfrancismiller original author: Scott Miller @scottfrancismiller
This commit is contained in:
parent
8073351d0c
commit
0fc04729be
2 changed files with 12 additions and 2 deletions
|
@ -49,6 +49,11 @@ class ClientRepository implements ClientRepositoryInterface
|
|||
/** @var \OAuth2Clients $client */
|
||||
$client = $this->beanManager->getBeanSafe(\OAuth2Clients::class, $clientIdentifier);
|
||||
|
||||
return hash('sha256', $clientSecret) === $client->secret && $grantType === $client->allowed_grant_type;
|
||||
if ($grantType === $client->allowed_grant_type || $grantType === 'refresh_token')
|
||||
{
|
||||
return hash('sha256', $clientSecret) === $client->secret;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,6 +75,11 @@ class ClientRepository implements ClientRepositoryInterface
|
|||
return null;
|
||||
}
|
||||
|
||||
return hash('sha256', $clientSecret) === $client->secret && $grantType === $client->allowed_grant_type;
|
||||
if ($grantType === $client->allowed_grant_type || $grantType === 'refresh_token')
|
||||
{
|
||||
return hash('sha256', $clientSecret) === $client->secret;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue