Skip to content

Commit f0f16f8

Browse files
committed
minor symfony#56840 [SecurityBundle] Allow configuring the secret used to sign login links (nicolas-grekas)
This PR was merged into the 7.2 branch. Discussion ---------- [SecurityBundle] Allow configuring the secret used to sign login links | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT To make it easier to use something else than `kernel.secret` if needed. Commits ------- e5c9eba [SecurityBundle] Allow configuring the secret used to sign login links
2 parents 412b276 + e5c9eba commit f0f16f8

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.2
5+
---
6+
7+
* Allow configuring the secret used to sign login links
8+
49
7.1
510
---
611

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/LoginLinkFactory.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ public function addConfiguration(NodeDefinition $node): void
6969
->scalarNode('provider')
7070
->info('The user provider to load users from.')
7171
->end()
72+
->scalarNode('secret')
73+
->cannotBeEmpty()
74+
->defaultValue('%kernel.secret%')
75+
->end()
7276
;
7377

7478
foreach (array_merge($this->defaultSuccessHandlerOptions, $this->defaultFailureHandlerOptions) as $name => $default) {
@@ -113,6 +117,7 @@ public function createAuthenticator(ContainerBuilder $container, string $firewal
113117
$container
114118
->setDefinition($signatureHasherId, new ChildDefinition('security.authenticator.abstract_login_link_signature_hasher'))
115119
->replaceArgument(1, $config['signature_properties'])
120+
->replaceArgument(2, $config['secret'])
116121
->replaceArgument(3, $expiredStorageId ? new Reference($expiredStorageId) : null)
117122
->replaceArgument(4, $config['max_uses'] ?? null)
118123
;

0 commit comments

Comments
 (0)