0
0
Fork 0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2025-01-10 11:37:53 +00:00

Fix - Access token wil not refresh for Oauth2 password clients

Kudos: Scott Miller @scottfrancismiller
original author: Scott Miller @scottfrancismiller
This commit is contained in:
Clemente Raposo 2024-06-27 16:43:01 +01:00 committed by Jack Anderson
parent 8073351d0c
commit 0fc04729be
2 changed files with 12 additions and 2 deletions
Api/V8/OAuth2/Repository
lib/API/OAuth2/Repositories

View file

@ -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;
}
}

View file

@ -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;
}
}