|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository
public final class HttpSessionCsrfTokenRepository
A CsrfTokenRepository
that stores the CsrfToken
in the HttpSession
.
Constructor Summary | |
---|---|
HttpSessionCsrfTokenRepository()
|
Method Summary | |
---|---|
CsrfToken |
generateAndSaveToken(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Generates and saves the expected CsrfToken |
CsrfToken |
loadToken(javax.servlet.http.HttpServletRequest request)
Loads the expected CsrfToken from the HttpServletRequest |
void |
saveToken(CsrfToken token,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Saves the CsrfToken using the HttpServletRequest and
HttpServletResponse . |
void |
setHeaderName(String parameterName)
Sets the header name that the CsrfToken is expected to appear on
and the header that the response will contain the CsrfToken . |
void |
setParameterName(String parameterName)
Sets the HttpServletRequest parameter name that the CsrfToken is expected to appear on |
void |
setSessionAttributeName(String sessionAttributeName)
Sets the HttpSession attribute name that the CsrfToken is stored in |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpSessionCsrfTokenRepository()
Method Detail |
---|
public void saveToken(CsrfToken token, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
CsrfTokenRepository
CsrfToken
using the HttpServletRequest
and
HttpServletResponse
. If the CsrfToken
is null, it is the
same as deleting it.
saveToken
in interface CsrfTokenRepository
token
- the CsrfToken
to save or null to deleterequest
- the HttpServletRequest
to useresponse
- the HttpServletResponse
to usepublic CsrfToken loadToken(javax.servlet.http.HttpServletRequest request)
CsrfTokenRepository
CsrfToken
from the HttpServletRequest
loadToken
in interface CsrfTokenRepository
request
- the HttpServletRequest
to use
CsrfToken
or null if none existspublic CsrfToken generateAndSaveToken(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
CsrfTokenRepository
CsrfToken
generateAndSaveToken
in interface CsrfTokenRepository
request
- the HttpServletRequest
to useresponse
- the HttpServletResponse
to use
CsrfToken
that was generated and saved. Cannot be
null.public void setParameterName(String parameterName)
HttpServletRequest
parameter name that the CsrfToken
is expected to appear on
parameterName
- the new parameter name to usepublic void setHeaderName(String parameterName)
CsrfToken
is expected to appear on
and the header that the response will contain the CsrfToken
.
parameterName
- the new parameter name to usepublic void setSessionAttributeName(String sessionAttributeName)
HttpSession
attribute name that the CsrfToken
is stored in
sessionAttributeName
- the new attribute name to use
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |