|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.filter.GenericFilterBean org.springframework.security.web.authentication.AnonymousAuthenticationFilter
public class AnonymousAuthenticationFilter
Detects if there is no Authentication
object in the SecurityContextHolder
, and
populates it with one if needed.
Field Summary |
---|
Fields inherited from class org.springframework.web.filter.GenericFilterBean |
---|
logger |
Constructor Summary | |
---|---|
AnonymousAuthenticationFilter()
Deprecated. Use constructor injection version |
|
AnonymousAuthenticationFilter(String key)
Creates a filter with a principal named "anonymousUser" and the single authority "ROLE_ANONYMOUS". |
|
AnonymousAuthenticationFilter(String key,
Object principal,
List<GrantedAuthority> authorities)
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
protected boolean |
applyAnonymousForThisRequest(javax.servlet.http.HttpServletRequest request)
Deprecated. no obvious use case and can easily be achieved by other means |
protected Authentication |
createAuthentication(javax.servlet.http.HttpServletRequest request)
|
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
|
List<GrantedAuthority> |
getAuthorities()
|
Object |
getPrincipal()
|
void |
setAuthenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
|
void |
setKey(String key)
Deprecated. use constructor injection instead |
void |
setUserAttribute(UserAttribute userAttributeDefinition)
Deprecated. use constructor injection instead |
Methods inherited from class org.springframework.web.filter.GenericFilterBean |
---|
addRequiredProperty, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Deprecated public AnonymousAuthenticationFilter()
public AnonymousAuthenticationFilter(String key)
key
- the key to identify tokens created by this filterpublic AnonymousAuthenticationFilter(String key, Object principal, List<GrantedAuthority> authorities)
key
- key the key to identify tokens created by this filterprincipal
- the principal which will be used to represent anonymous usersauthorities
- the authority list for anonymous usersMethod Detail |
---|
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class GenericFilterBean
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
@Deprecated protected boolean applyAnonymousForThisRequest(javax.servlet.http.HttpServletRequest request)
request
- to assist the method determine request details
true
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)
public void setAuthenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
public Object getPrincipal()
public List<GrantedAuthority> getAuthorities()
@Deprecated public void setKey(String key)
@Deprecated public void setUserAttribute(UserAttribute userAttributeDefinition)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |