Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit13f57a2

Browse files
committed
[fixed] Fixed example code so that custom authentication providers only clear their own tokens
1 parent4eeec12 commit13f57a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎cookbook/security/custom_authentication_provider.rst‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ set an authenticated token in the security context if successful.
144144
// ... you might log something here
145145
146146
// To deny the authentication clear the token. This will redirect to the login page.
147-
// $this->securityContext->setToken(null);
147+
// 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+
// }
148152
// return;
149153
150154
// Deny authentication with a '403 Forbidden' HTTP response

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp