Interface CsrfTokenRepository
- 
- All Known Implementing Classes:
- CookieCsrfTokenRepository,- HttpSessionCsrfTokenRepository,- LazyCsrfTokenRepository
 
 public interface CsrfTokenRepositoryAn API to allow changing the method in which the expectedCsrfTokenis associated to theHttpServletRequest. For example, it may be stored inHttpSession.- Since:
- 3.2
- See Also:
- HttpSessionCsrfTokenRepository
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description CsrfTokengenerateToken(javax.servlet.http.HttpServletRequest request)Generates aCsrfTokenCsrfTokenloadToken(javax.servlet.http.HttpServletRequest request)Loads the expectedCsrfTokenfrom theHttpServletRequestvoidsaveToken(CsrfToken token, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
 
- 
- 
- 
Method Detail- 
generateTokenCsrfToken generateToken(javax.servlet.http.HttpServletRequest request) Generates aCsrfToken- Parameters:
- request- the- HttpServletRequestto use
- Returns:
- the CsrfTokenthat was generated. Cannot be null.
 
 - 
saveTokenvoid saveToken(CsrfToken token, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Saves theCsrfTokenusing theHttpServletRequestandHttpServletResponse. If theCsrfTokenis null, it is the same as deleting it.- Parameters:
- token- the- CsrfTokento save or null to delete
- request- the- HttpServletRequestto use
- response- the- HttpServletResponseto use
 
 
- 
 
-