public class AnonymousAuthenticationFilter
extends GenericFilterBean
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(HttpServletRequest request) |
void |
doFilter(ServletRequest req,
ServletResponse res,
FilterChain chain) |
java.util.List<GrantedAuthority> |
getAuthorities() |
java.lang.Object |
getPrincipal() |
void |
setAuthenticationDetailsSource(AuthenticationDetailsSource<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()
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws java.io.IOException, ServletException
java.io.IOException
ServletException
protected Authentication createAuthentication(HttpServletRequest request)
public void setAuthenticationDetailsSource(AuthenticationDetailsSource<HttpServletRequest,?> authenticationDetailsSource)
public java.lang.Object getPrincipal()
public java.util.List<GrantedAuthority> getAuthorities()