bug #12002 [Security] [Firewall] Bug fixed in SimplePreAuthenticationListener when createToken() not return TokenInterface object (adenkejawen, fabpot)
This PR was merged into the 2.4 branch. Discussion ---------- [Security] [Firewall] Bug fixed in SimplePreAuthenticationListener when createToken() not return TokenInterface object | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | #11490, #11414 | License | MIT | Doc PR | This is a follow-up for #11414 on the right branch. Commits -------faa8e98
fixed buge85cb7f
added the possibility to return null from SimplePreAuthenticationListener
This commit is contained in:
commit
93333957e1
@ -76,6 +76,12 @@ class SimplePreAuthenticationListener implements ListenerInterface
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$token = $this->simpleAuthenticator->createToken($request, $this->providerKey);
|
$token = $this->simpleAuthenticator->createToken($request, $this->providerKey);
|
||||||
|
|
||||||
|
// allow null to be returned to skip authentication
|
||||||
|
if (null === $token) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$token = $this->authenticationManager->authenticate($token);
|
$token = $this->authenticationManager->authenticate($token);
|
||||||
$this->securityContext->setToken($token);
|
$this->securityContext->setToken($token);
|
||||||
} catch (AuthenticationException $e) {
|
} catch (AuthenticationException $e) {
|
||||||
|
Reference in New Issue
Block a user