public abstract class CsrfPreventionFilterBase extends FilterBase
sm
Constructor and Description |
---|
CsrfPreventionFilterBase() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
generateNonce()
Generate a once time token (nonce) for authenticating subsequent
requests.
|
int |
getDenyStatus()
Return response status code that is used to reject denied request.
|
protected Log |
getLogger() |
protected java.lang.String |
getRequestedPath(HttpServletRequest request) |
void |
init(FilterConfig filterConfig)
Iterates over the configuration parameters and either logs a warning,
or throws an exception for any parameter that does not have a matching
setter in this filter.
|
protected boolean |
isConfigProblemFatal()
Determines if an exception when calling a setter or an unknown
configuration attribute triggers the failure of the this filter which in
turn will prevent the web application from starting.
|
void |
setDenyStatus(int denyStatus)
Set response status code that is used to reject denied request.
|
void |
setRandomClass(java.lang.String randomClass)
Specify the class to use to generate the nonces.
|
destroy
protected Log getLogger()
getLogger
in class FilterBase
public int getDenyStatus()
public void setDenyStatus(int denyStatus)
denyStatus
- HTTP status codepublic void setRandomClass(java.lang.String randomClass)
Random
.randomClass
- The name of the class to usepublic void init(FilterConfig filterConfig) throws ServletException
FilterBase
init
in interface Filter
init
in class FilterBase
filterConfig
- The configuration information associated with the
filter instance being initialisedServletException
- if FilterBase.isConfigProblemFatal()
returns
true
and a configured parameter does not
have a matching setterprotected boolean isConfigProblemFatal()
FilterBase
isConfigProblemFatal
in class FilterBase
true
if a problem should trigger the failure of this
filter, else false
protected java.lang.String generateNonce()
protected java.lang.String getRequestedPath(HttpServletRequest request)
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.