aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2023-04-04 06:30:25 +0000
committerJan-Hendrik Willms <tleilax+github@gmail.com>2023-04-04 09:01:36 +0200
commitf73eeeaedabf936168897ca0eaf704ec2c55aad0 (patch)
treedb0d453db187e079b8e985f70e9cf9dd936eebd4 /lib
parent9ab4cbefe0e8feb45795930b97cfef501a6f55cf (diff)
allow grant type 'refresh_token' as well, fixes #2507
Closes #2507 Merge request studip/studip!1694
Diffstat (limited to 'lib')
-rw-r--r--lib/classes/OAuth2/Bridge/ClientRepository.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/classes/OAuth2/Bridge/ClientRepository.php b/lib/classes/OAuth2/Bridge/ClientRepository.php
index b6fd4f6..526e839 100644
--- a/lib/classes/OAuth2/Bridge/ClientRepository.php
+++ b/lib/classes/OAuth2/Bridge/ClientRepository.php
@@ -37,9 +37,10 @@ class ClientRepository implements ClientRepositoryInterface
*/
public function validateClient($clientIdentifier, $clientSecret, $grantType): bool
{
- if ($grantType !== 'authorization_code') {
+ if (!in_array($grantType, ['authorization_code', 'refresh_token'])) {
return false;
}
+
$client = Client::findActive($clientIdentifier);
if (!$client) {
return false;