public class AnonymousProcessingFilter extends SpringSecurityFilter implements org.springframework.beans.factory.InitializingBean
Authentication
object in the SecurityContextHolder
, and
populates it with one if needed.logger
Constructor and Description |
---|
AnonymousProcessingFilter() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected boolean |
applyAnonymousForThisRequest(javax.servlet.http.HttpServletRequest request)
Enables subclasses to determine whether or not an anonymous authentication token should be setup for
this request.
|
protected Authentication |
createAuthentication(javax.servlet.http.HttpServletRequest request) |
protected void |
doFilterHttp(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain) |
java.lang.String |
getKey() |
int |
getOrder() |
UserAttribute |
getUserAttribute() |
boolean |
isRemoveAfterRequest() |
void |
setAuthenticationDetailsSource(AuthenticationDetailsSource authenticationDetailsSource) |
void |
setKey(java.lang.String key) |
void |
setRemoveAfterRequest(boolean removeAfterRequest)
Controls whether the filter will remove the Anonymous token after the request is complete.
|
void |
setUserAttribute(UserAttribute userAttributeDefinition) |
destroy, doFilter, init, toString
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
protected boolean applyAnonymousForThisRequest(javax.servlet.http.HttpServletRequest request)
request
- to assist the method determine request detailstrue
if the anonymous token should be setup for this request (provided that the request
doesn't already have some other Authentication
inside it), or false
if no
anonymous token should be setup for this requestprotected Authentication createAuthentication(javax.servlet.http.HttpServletRequest request)
protected void doFilterHttp(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException
doFilterHttp
in class SpringSecurityFilter
java.io.IOException
javax.servlet.ServletException
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
public java.lang.String getKey()
public UserAttribute getUserAttribute()
public boolean isRemoveAfterRequest()
public void setAuthenticationDetailsSource(AuthenticationDetailsSource authenticationDetailsSource)
public void setKey(java.lang.String key)
public void setRemoveAfterRequest(boolean removeAfterRequest)
HttpSessionContextIntegrationFilter
simply to
store the Anonymous authentication token.Defaults to true
, being the most optimal and
appropriate option (ie AnonymousProcessingFilter
will clear the token at the end of each request,
thus avoiding the session creation overhead in a typical configuration.
removeAfterRequest
- DOCUMENT ME!public void setUserAttribute(UserAttribute userAttributeDefinition)