Skip to content

Commit 0ab19aa

Browse files
committed
Merge branch 'develop'
2 parents 3c7478e + da04f4b commit 0ab19aa

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/Security/OpenIdConfigurationProvider.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
class OpenIdConfigurationProvider extends AbstractProvider
3737
{
38-
private const CACHE_KEY = 'itk-openid-connect-configuration-';
38+
private const CACHE_KEY_PREFIX = 'itk-openid-connect-configuration-';
3939
private const POST_LOGOUT_REDIRECT_URI = 'post_logout_redirect_uri';
4040
private const STATE = 'state';
4141

@@ -353,7 +353,7 @@ protected function createResourceOwner(array $response, AccessToken $token)
353353
*/
354354
private function getJwtVerificationKeys(): array
355355
{
356-
$cacheKey = self::CACHE_KEY . 'jwks';
356+
$cacheKey = $this->getCacheKey('jwks');
357357

358358
$keys = [];
359359

@@ -457,7 +457,7 @@ private function fetchJsonResource(string $resourceUrl): array
457457
*/
458458
private function getConfiguration(string $key): string
459459
{
460-
$cacheKey = self::CACHE_KEY . 'configuration';
460+
$cacheKey = $this->getCacheKey('configuration');
461461

462462
try {
463463
assert($this->cacheItemPool instanceof CacheItemPoolInterface);
@@ -482,4 +482,13 @@ private function getConfiguration(string $key): string
482482
throw new CacheException($e->getMessage());
483483
}
484484
}
485+
486+
private function getCacheKey(string $name): string
487+
{
488+
return implode('||', [
489+
self::CACHE_KEY_PREFIX,
490+
hash('sha1', $this->openIDConnectMetadataUrl),
491+
$name,
492+
]);
493+
}
485494
}

0 commit comments

Comments
 (0)