public class AnonymousAuthenticationFilter
extends org.springframework.web.filter.GenericFilterBean
implements org.springframework.beans.factory.InitializingBean
Authentication object in the
SecurityContextHolder, and populates it with one if needed.| Constructor and Description |
|---|
AnonymousAuthenticationFilter(java.lang.String key)
Creates a filter with a principal named "anonymousUser" and the single authority
"ROLE_ANONYMOUS".
|
AnonymousAuthenticationFilter(java.lang.String key,
java.lang.Object principal,
java.util.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) |
java.util.List<GrantedAuthority> |
getAuthorities() |
java.lang.Object |
getPrincipal() |
void |
setAuthenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource) |
public AnonymousAuthenticationFilter(java.lang.String key)
key - the key to identify tokens created by this filterpublic AnonymousAuthenticationFilter(java.lang.String key,
java.lang.Object principal,
java.util.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 org.springframework.beans.factory.InitializingBeanafterPropertiesSet in class org.springframework.web.filter.GenericFilterBeanpublic void doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
throws java.io.IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.Filterjava.io.IOExceptionjavax.servlet.ServletExceptionprotected Authentication createAuthentication(javax.servlet.http.HttpServletRequest request)
public void setAuthenticationDetailsSource(AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
public java.lang.Object getPrincipal()
public java.util.List<GrantedAuthority> getAuthorities()