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<org.springframework.security.core.GrantedAuthority> authorities) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected org.springframework.security.core.Authentication |
createAuthentication(javax.servlet.http.HttpServletRequest request) |
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain) |
List<org.springframework.security.core.GrantedAuthority> |
getAuthorities() |
Object |
getPrincipal() |
void |
setAuthenticationDetailsSource(org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource) |
addRequiredProperty, destroy, 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<org.springframework.security.core.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 org.springframework.security.core.Authentication createAuthentication(javax.servlet.http.HttpServletRequest request)
public void setAuthenticationDetailsSource(org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
public Object getPrincipal()
public List<org.springframework.security.core.GrantedAuthority> getAuthorities()