public interface CsrfTokenRepository
CsrfToken
is
associated to the HttpServletRequest
. For example, it may be stored in
HttpSession
.HttpSessionCsrfTokenRepository
Modifier and Type | Method and Description |
---|---|
CsrfToken |
generateToken(HttpServletRequest request)
Generates a
CsrfToken |
CsrfToken |
loadToken(HttpServletRequest request)
Loads the expected
CsrfToken from the HttpServletRequest |
void |
saveToken(CsrfToken token,
HttpServletRequest request,
HttpServletResponse response)
|
CsrfToken generateToken(HttpServletRequest request)
CsrfToken
request
- the HttpServletRequest
to useCsrfToken
that was generated. Cannot be null.void saveToken(CsrfToken token, HttpServletRequest request, HttpServletResponse response)
CsrfToken
using the HttpServletRequest
and
HttpServletResponse
. If the CsrfToken
is null, it is the same as
deleting it.token
- the CsrfToken
to save or null to deleterequest
- the HttpServletRequest
to useresponse
- the HttpServletResponse
to use