Skip to content

Commit e36bb3f

Browse files
Merge branch '6.2' into 6.3
* 6.2: [Translation] Fix merge [SecurityBundle] Fix `Security::login()` on specific firewall [MonologBridge] FirePHPHandler::onKernelResponse throws PHP 8.1 deprecation when no user agent is set [Form] Skip password hashing on empty password Update Redis version to 6.2.8 [Contracts] Fix setting $container before calling parent::setContainer in ServiceSubscriberTrait [Messenger][Cache] fixed CallbackInterface support in async expiration handler do not drop embed label classes
2 parents 844f8f8 + 601bcc1 commit e36bb3f

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

Resources/config/security.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
service_locator([
8484
'security.token_storage' => service('security.token_storage'),
8585
'security.authorization_checker' => service('security.authorization_checker'),
86-
'security.user_authenticator' => service('security.user_authenticator')->ignoreOnInvalid(),
86+
'security.authenticator.managers_locator' => service('security.authenticator.managers_locator')->ignoreOnInvalid(),
8787
'request_stack' => service('request_stack'),
8888
'security.firewall.map' => service('security.firewall.map'),
8989
'security.user_checker' => service('security.user_checker'),

Security.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function login(UserInterface $user, string $authenticatorName = null, str
7272

7373
$this->container->get('security.user_checker')->checkPreAuth($user);
7474

75-
return $this->container->get('security.user_authenticator')->authenticateUser($user, $authenticator, $request);
75+
return $this->container->get('security.authenticator.managers_locator')->get($firewallName)->authenticateUser($user, $authenticator, $request);
7676
}
7777

7878
/**

Tests/Functional/app/SecurityHelper/config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@ security:
4040
custom_authenticators:
4141
- 'Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AuthenticatorBundle\ApiAuthenticator'
4242
provider: main
43+
second:
44+
pattern: ^/second
45+
form_login:
46+
check_path: /second/login/check
47+
custom_authenticators:
48+
- 'Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AuthenticatorBundle\ApiAuthenticator'
49+
provider: main
4350

4451
access_control:
4552
- { path: '^/main/login/check$', roles: IS_AUTHENTICATED_FULLY }
4653
- { path: '^/main/logged-in$', roles: IS_AUTHENTICATED_FULLY }
54+
- { path: '^/second/login/check$', roles: IS_AUTHENTICATED_FULLY }
55+
- { path: '^/second/logged-in$', roles: IS_AUTHENTICATED_FULLY }

Tests/Functional/app/SecurityHelper/routing.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@ logged-in:
99
force-logout:
1010
path: /main/force-logout
1111
controller: Symfony\Bundle\SecurityBundle\Tests\Functional\LogoutController::logout
12+
13+
second-force-login:
14+
path: /second/force-login
15+
controller: Symfony\Bundle\SecurityBundle\Tests\Functional\ForceLoginController::welcome
16+
17+
second-logged-in:
18+
path: /second/logged-in
19+
controller: Symfony\Bundle\SecurityBundle\Tests\Functional\LoggedInController

Tests/SecurityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function testLogin()
141141
->willReturnMap([
142142
['request_stack', $requestStack],
143143
['security.firewall.map', $firewallMap],
144-
['security.user_authenticator', $userAuthenticator],
144+
['security.authenticator.managers_locator', new ServiceLocator(['main' => fn () => $userAuthenticator])],
145145
['security.user_checker', $userChecker],
146146
])
147147
;

0 commit comments

Comments
 (0)