Fixed lack of oidc discovery filtering during testing

Tested oidc system on okta, Keycloak & Auth0
This commit is contained in:
Dan Brown 2021-10-14 13:37:55 +01:00
parent a5d72aa458
commit 855409bc4f
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 5 additions and 3 deletions

View File

@ -149,7 +149,7 @@ class OidcProviderSettings
if (!empty($result['jwks_uri'])) {
$keys = $this->loadKeysFromUri($result['jwks_uri'], $httpClient);
$discoveredSettings['keys'] = array_filter($keys);
$discoveredSettings['keys'] = $this->filterKeys($keys);
}
return $discoveredSettings;
@ -161,7 +161,7 @@ class OidcProviderSettings
protected function filterKeys(array $keys): array
{
return array_filter($keys, function(array $key) {
return $key['key'] === 'RSA' && $key['use'] === 'sig' && $key['alg'] === 'RS256';
return $key['kty'] === 'RSA' && $key['use'] === 'sig' && $key['alg'] === 'RS256';
});
}

View File

@ -80,7 +80,9 @@ class AppServiceProvider extends ServiceProvider
});
$this->app->bind(HttpClientInterface::class, function($app) {
return new Client(['timeout' => 3]);
return new Client([
'timeout' => 3,
]);
});
}
}