public class AnonymousAuthenticationFilter extends GenericFilterBean implements InitializingBean
Authentication object in the
SecurityContextHolder, and populates it with one if needed.logger| Constructor and Description |
|---|
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) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
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) |
addRequiredProperty, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContextpublic 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 userspublic void afterPropertiesSet()
afterPropertiesSet in interface InitializingBeanafterPropertiesSet in class GenericFilterBeanpublic void doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.FilterIOExceptionjavax.servlet.ServletExceptionprotected Authentication createAuthentication(javax.servlet.http.HttpServletRequest request)
public void setAuthenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
public Object getPrincipal()
public List<GrantedAuthority> getAuthorities()