From 386c5ccb7e7ca91b4b4d1e28ceb38acb3885d863 Mon Sep 17 00:00:00 2001 From: tuutti Date: Thu, 21 Dec 2023 09:20:46 +0200 Subject: [PATCH] UHF-9458: Re-added dfault scopes --- src/Plugin/OpenIDConnectClient/Tunnistamo.php | 2 +- tests/src/Kernel/TunnistamoClientTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Plugin/OpenIDConnectClient/Tunnistamo.php b/src/Plugin/OpenIDConnectClient/Tunnistamo.php index 97e2028..529ddcb 100644 --- a/src/Plugin/OpenIDConnectClient/Tunnistamo.php +++ b/src/Plugin/OpenIDConnectClient/Tunnistamo.php @@ -297,7 +297,7 @@ public function getClientScopes(): array { $scopes = $this->configuration['client_scopes'] ?? []; if (!$scopes) { - return []; + return parent::getClientScopes(); } return explode(',', $this->configuration['client_scopes']); } diff --git a/tests/src/Kernel/TunnistamoClientTest.php b/tests/src/Kernel/TunnistamoClientTest.php index 6398d56..65bbca3 100644 --- a/tests/src/Kernel/TunnistamoClientTest.php +++ b/tests/src/Kernel/TunnistamoClientTest.php @@ -22,7 +22,7 @@ public function testGetClientScopes() : void { $config = $plugin->getConfiguration(); $this->assertSame($config['client_scopes'], $plugin->defaultConfiguration()['client_scopes']); $this->setPluginConfiguration('client_scopes', ''); - $this->assertSame([], $this->getPlugin()->getClientScopes()); + $this->assertSame(['openid', 'email'], $this->getPlugin()->getClientScopes()); } /**