Class CsrfLogoutHandler
java.lang.Object
org.springframework.security.web.csrf.CsrfLogoutHandler
- All Implemented Interfaces:
LogoutHandler
CsrfLogoutHandler
is in charge of removing the CsrfToken
upon logout. A
new CsrfToken
will then be generated by the framework upon the next request.- Since:
- 3.2
-
Constructor Summary
ConstructorDescriptionCsrfLogoutHandler
(CsrfTokenRepository csrfTokenRepository) Creates a new instance -
Method Summary
Modifier and TypeMethodDescriptionvoid
logout
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) Clears theCsrfToken
-
Constructor Details
-
CsrfLogoutHandler
Creates a new instance- Parameters:
csrfTokenRepository
- theCsrfTokenRepository
to use
-
-
Method Details
-
logout
public void logout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Authentication authentication) Clears theCsrfToken
- Specified by:
logout
in interfaceLogoutHandler
- Parameters:
request
- the HTTP requestresponse
- the HTTP responseauthentication
- the current principal details- See Also:
-