public class AnonymousProcessingFilter extends Object implements javax.servlet.Filter, org.springframework.beans.factory.InitializingBean
Authentication
object in the SecurityContextHolder
, and
populates it with one if needed.Do not use this class directly. Instead configure web.xml
to use the FilterToBeanProxy
.
Constructor and Description |
---|
AnonymousProcessingFilter() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected boolean |
applyAnonymousForThisRequest(javax.servlet.ServletRequest request)
Enables subclasses to determine whether or not an anonymous authentication token should be setup for
this request.
|
protected Authentication |
createAuthentication(javax.servlet.ServletRequest request) |
void |
destroy()
Does nothing - we reply on IoC lifecycle services instead.
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
String |
getKey() |
UserAttribute |
getUserAttribute() |
void |
init(javax.servlet.FilterConfig ignored)
Does nothing - we reply on IoC lifecycle services instead.
|
boolean |
isRemoveAfterRequest() |
void |
setAuthenticationDetailsSource(AuthenticationDetailsSource authenticationDetailsSource) |
void |
setKey(String key) |
void |
setRemoveAfterRequest(boolean removeAfterRequest)
Controls whether the filter will remove the Anonymous token after the request is complete.
|
void |
setUserAttribute(UserAttribute userAttributeDefinition) |
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
protected boolean applyAnonymousForThisRequest(javax.servlet.ServletRequest 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.ServletRequest request)
public void destroy()
destroy
in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
public String getKey()
public UserAttribute getUserAttribute()
public void init(javax.servlet.FilterConfig ignored) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
ignored
- not usedjavax.servlet.ServletException
- DOCUMENT ME!public boolean isRemoveAfterRequest()
public void setAuthenticationDetailsSource(AuthenticationDetailsSource authenticationDetailsSource)
public void setKey(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)
Copyright © 2014. All rights reserved.