Class ServerHttpSecurity.AnonymousSpec
- java.lang.Object
 - 
- org.springframework.security.config.web.server.ServerHttpSecurity.AnonymousSpec
 
 
- 
- Enclosing class:
 - ServerHttpSecurity
 
public final class ServerHttpSecurity.AnonymousSpec extends java.lang.ObjectConfigures anonymous authentication- Since:
 - 5.2.0
 
 
- 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerHttpSecurityand()Allows method chaining to continue configuring theServerHttpSecurityServerHttpSecurity.AnonymousSpecauthenticationFilter(AnonymousAuthenticationWebFilter authenticationFilter)Sets theAnonymousAuthenticationWebFilterused to populate an anonymous user.ServerHttpSecurity.AnonymousSpecauthorities(java.lang.String... authorities)Sets theAuthentication.getAuthorities()for anonymous usersServerHttpSecurity.AnonymousSpecauthorities(java.util.List<GrantedAuthority> authorities)Sets theAuthentication.getAuthorities()for anonymous usersprotected voidconfigure(ServerHttpSecurity http)ServerHttpSecuritydisable()Disables anonymous authentication.ServerHttpSecurity.AnonymousSpeckey(java.lang.String key)Sets the key to identify tokens created for anonymous authentication.ServerHttpSecurity.AnonymousSpecprincipal(java.lang.Object principal)Sets the principal forAuthenticationobjects of anonymous users 
 - 
 
- 
- 
Method Detail
- 
key
public ServerHttpSecurity.AnonymousSpec key(java.lang.String key)
Sets the key to identify tokens created for anonymous authentication. Default is a secure randomly generated key.- Parameters:
 key- the key to identify tokens created for anonymous authentication. Default is a secure randomly generated key.- Returns:
 - the 
ServerHttpSecurity.AnonymousSpecfor further customization of anonymous authentication 
 
- 
principal
public ServerHttpSecurity.AnonymousSpec principal(java.lang.Object principal)
Sets the principal forAuthenticationobjects of anonymous users- Parameters:
 principal- used for theAuthenticationobject of anonymous users- Returns:
 - the 
ServerHttpSecurity.AnonymousSpecfor further customization of anonymous authentication 
 
- 
authorities
public ServerHttpSecurity.AnonymousSpec authorities(java.util.List<GrantedAuthority> authorities)
Sets theAuthentication.getAuthorities()for anonymous users- Parameters:
 authorities- Sets theAuthentication.getAuthorities()for anonymous users- Returns:
 - the 
ServerHttpSecurity.AnonymousSpecfor further customization of anonymous authentication 
 
- 
authorities
public ServerHttpSecurity.AnonymousSpec authorities(java.lang.String... authorities)
Sets theAuthentication.getAuthorities()for anonymous users- Parameters:
 authorities- Sets theAuthentication.getAuthorities()for anonymous users (i.e. "ROLE_ANONYMOUS")- Returns:
 - the 
ServerHttpSecurity.AnonymousSpecfor further customization of anonymous authentication 
 
- 
authenticationFilter
public ServerHttpSecurity.AnonymousSpec authenticationFilter(AnonymousAuthenticationWebFilter authenticationFilter)
Sets theAnonymousAuthenticationWebFilterused to populate an anonymous user. If this is set, no attributes on theServerHttpSecurity.AnonymousSpecwill be set on theAnonymousAuthenticationWebFilter.- Parameters:
 authenticationFilter- theAnonymousAuthenticationWebFilterused to populate an anonymous user.- Returns:
 - the 
ServerHttpSecurity.AnonymousSpecfor further customization of anonymous authentication 
 
- 
and
public ServerHttpSecurity and()
Allows method chaining to continue configuring theServerHttpSecurity- Returns:
 - the 
ServerHttpSecurityto continue configuring 
 
- 
disable
public ServerHttpSecurity disable()
Disables anonymous authentication.- Returns:
 - the 
ServerHttpSecurityto continue configuring 
 
- 
configure
protected void configure(ServerHttpSecurity http)
 
 - 
 
 -