We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3d1f59f + 13f57a2 commit f6eec74Copy full SHA for f6eec74
cookbook/security/custom_authentication_provider.rst
@@ -144,7 +144,11 @@ set an authenticated token in the security context if successful.
144
// ... you might log something here
145
146
// To deny the authentication clear the token. This will redirect to the login page.
147
- // $this->securityContext->setToken(null);
+ // Make sure to only clear your token, not those of other authentication listeners.
148
+ // $token = $this->securityContext->getToken();
149
+ // if ($token instanceof WsseUserToken && $this->providerKey === $token->getProviderKey()) {
150
+ // $this->securityContext->setToken(null);
151
+ // }
152
// return;
153
154
// Deny authentication with a '403 Forbidden' HTTP response
0 commit comments