public class CsrfValidator extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CSRF_PARAMETER |
static String |
CSRF_SESSION_TOKEN |
| Constructor and Description |
|---|
CsrfValidator() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getRequestToken(javax.servlet.http.HttpServletRequest request)
Retrieve the CSRF token parameter that is on the given request, or null if the request has none.
|
static String |
getSessionToken(javax.servlet.http.HttpServletRequest request)
Retrieve the CSRF token that is associated with the session for the given request, or null if the session has none.
|
static boolean |
validateCsrf(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Applies CSRF protection for any HTTP method other than GET, HEAD, or OPTIONS.
|
public static final String CSRF_PARAMETER
public static final String CSRF_SESSION_TOKEN
public CsrfValidator()
public static boolean validateCsrf(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
request - the http request to checkresponse - the http response associated with the given requestpublic static String getSessionToken(javax.servlet.http.HttpServletRequest request)
request - the request to check the session for the CSRF tokenpublic static String getRequestToken(javax.servlet.http.HttpServletRequest request)
request - the request to check for the CSRF token parameterCopyright © 2005–2018 The Kuali Foundation. All rights reserved.