Interface CsrfTokenRepository
- All Known Implementing Classes:
SessionCsrfTokenRepository,SpringCsrfTokenRepository
public interface CsrfTokenRepository
Generates CSRF tokens.
Note that the tokens should be generated in safe way - that means they should not be guessable.
-
Method Summary
-
Method Details
-
generateToken
CsrfToken generateToken()- Returns:
- a newly generated CSRF token
-
saveToken
Saves theCsrfTokenusing theHttpServletRequestandHttpServletResponse. If theCsrfTokenis null, it is the same as deleting it.- Parameters:
token- theCsrfTokento save or null to delete
-
loadToken
CsrfToken loadToken()Loads the expectedCsrfTokenfrom theHttpServletRequest- Returns:
- the
CsrfTokenor null if none exists
-