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
ConstructorsConstructorDescriptionCsrfLogoutHandler(CsrfTokenRepository csrfTokenRepository) Creates a new instance -
Method Summary
Modifier and TypeMethodDescriptionvoidlogout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, @Nullable Authentication authentication) Clears theCsrfToken
-
Constructor Details
-
CsrfLogoutHandler
Creates a new instance- Parameters:
csrfTokenRepository- theCsrfTokenRepositoryto use
-
-
Method Details
-
logout
public void logout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, @Nullable Authentication authentication) Clears theCsrfToken- Specified by:
logoutin interfaceLogoutHandler- Parameters:
request- the HTTP requestresponse- the HTTP responseauthentication- the current principal details- See Also:
-