public class KeyBasedSecurityFilter
extends org.springframework.web.filter.OncePerRequestFilter
nameOfIdentifier
match if the provided value of nameOfKey
matches.
Executes a configured Transformer
that returns a hashed key. The filter then compared the 2 hashed keys and determines to allow the request to go through or not.
transformer
throws a ValidationException
, then it is redirected to a validation page (if defined) else goes to access denied page.transformer
throws a ContinueProcessingException
then it will skip/bypass any check needed.Constructor and Description |
---|
KeyBasedSecurityFilter() |
Modifier and Type | Method and Description |
---|---|
protected void |
doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain) |
String |
getEncoding() |
String |
getNameOfIdentifier()
Name of the parameter is is the identifier
|
String |
getNameOfKey()
Name of the parameter that is the key
|
String |
getTransformerBeanName()
Bean name of the Spring instantiated
Transformer transformer . |
String |
getUnauthorizedRedirectUrl()
Absolute path for redirected url with
nameOfIdentifier appended to it. |
String |
getValidationRedirectUrl()
Absolute path for redirected url with
nameOfIdentifier and validaton exception cause appended to it. |
void |
initFilterBean() |
void |
setEncoding(String encoding) |
void |
setNameOfIdentifier(String nameOfIdentifier)
Name of the parameter is is the identifier
|
void |
setNameOfKey(String nameOfKey)
Name of the parameter that is the key
|
void |
setTransformerBeanName(String transformerBeanName)
Bean name of the Spring instantiated
Transformer transformer . |
void |
setUnauthorizedRedirectUrl(String unauthorizedRedirectUrl)
Absolute path for redirected url with
nameOfIdentifier appended to it. |
void |
setValidationRedirectUrl(String validationRedirectUrl)
Absolute path for redirected url with
nameOfIdentifier and validaton exception cause appended to it. |
protected void |
unauthorizedError(javax.servlet.http.HttpServletResponse response,
String id,
int httpResponseCode) |
protected void |
validationError(javax.servlet.http.HttpServletResponse response,
String id,
int httpResponseCode,
Exception e) |
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
public void initFilterBean()
initFilterBean
in class org.springframework.web.filter.GenericFilterBean
protected void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) throws javax.servlet.ServletException, IOException
doFilterInternal
in class org.springframework.web.filter.OncePerRequestFilter
javax.servlet.ServletException
IOException
protected void unauthorizedError(javax.servlet.http.HttpServletResponse response, String id, int httpResponseCode) throws IOException
IOException
protected void validationError(javax.servlet.http.HttpServletResponse response, String id, int httpResponseCode, Exception e) throws IOException
IOException
public String getNameOfKey()
public void setNameOfKey(String nameOfKey)
public String getNameOfIdentifier()
public void setNameOfIdentifier(String nameOfIdentifier)
public String getTransformerBeanName()
Transformer
transformer
.transformer
public void setTransformerBeanName(String transformerBeanName)
Transformer
transformer
.transformer
public String getUnauthorizedRedirectUrl()
nameOfIdentifier
appended to it.
HttpServletResponse.SC_UNAUTHORIZED
public void setUnauthorizedRedirectUrl(String unauthorizedRedirectUrl)
nameOfIdentifier
appended to it.
HttpServletResponse.SC_UNAUTHORIZED
public String getValidationRedirectUrl()
nameOfIdentifier
and validaton exception cause appended to it.
unauthorizedRedirectUrl
public void setValidationRedirectUrl(String validationRedirectUrl)
nameOfIdentifier
and validaton exception cause appended to it.
unauthorizedRedirectUrl
public String getEncoding()
public void setEncoding(String encoding)
Copyright © 2018. All rights reserved.