8000 Remove jwks_url parameter · symfony/symfony@e124d0a · GitHub
[go: up one dir, main page]

Skip to content

Commit e124d0a

Browse files
Remove jwks_url parameter
1 parent 4c2c19f commit e124d0a

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ CHANGELOG
55
---
66

77
* Mark class `ExpressionCacheWarmer` as `final`
8-
* Add `jwks_url` option in oidc token handler configuration
98

109
7.0
1110
---

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/AccessToken/OidcTokenHandlerFactory.php

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\DependencyInjection\ContainerBuilder;
1818
use Symfony\Component\DependencyInjection\Exception\LogicException;
1919
use Symfony\Component\DependencyInjection\Reference;
20-
use Symfony\Component\HttpClient\HttpClient;
2120

2221
/**
2322
* Configures a token handler for decoding and validating an OIDC token.
@@ -52,27 +51,13 @@ public function create(ContainerBuilder $container, string $id, array|string $co
5251

5352
$tokenHandlerDefinition->replaceArgument(0, $algorithmManagerDefinition);
5453

55-
if (!isset($config['jwks_url']) && !isset($config['key'])) {
56-
throw new LogicException('You should defined key or jwks_url parameter in configuration.');
54+
if (!isset($config['key'])) {
55+
throw new LogicException('You should defined key parameter in configuration.');
5756
}
5857

59-
if (isset($config['jwks_url'])) {
60-
if (!class_exists(HttpClient::class)) {
61-
throw new LogicException(sprintf('You cannot use "%s" as the HttpClient component is not installed. Try running "composer require symfony/http-client".', __CLASS__));
62-
}
63-
$httpClient = HttpClient::create();
64-
$response = $httpClient->request(
65-
'GET',
66-
$config['jwks_url']
67-
);
68-
$jwkDefinition = (new ChildDefinition('security.access_token_handler.oidc.jwk_set'))
69-
->replaceArgument(0, $response->getContent());
70-
} elseif (isset($config['key'])) {
71-
$jwkDefinition = (new ChildDefinition('security.access_token_handler.oidc.jwk'))
72-
->replaceArgument(0, $config['key']);
73-
}
74-
75-
$tokenHandlerDefinition->replaceArgument(1, $jwkDefinition);
58+
$tokenHandlerDefinition->replaceArgument(1, (new ChildDefinition('security.access_token_handler.oidc.jwk'))
59+
->replaceArgument(0, $config['key'])
60+
);
7661
}
7762

7863
public 72F1 function getKey(): string
@@ -106,9 +91,6 @@ public function addConfiguration(NodeBuilder $node): void
10691
->scalarNode('key')
10792
->info('JSON-encoded JWK used to sign the token (must contain a "kty" key).')
10893
->end()
109-
->scalarNode('jwks_url')
110-
->info('Url to retrieve JWKSet JSON-encoded (must contain a "keys" key).')
111-
->end()
11294
->end()
11395
->end()
11496
;

0 commit comments

Comments
 (0)
0