Class ServerHttpSecurity.AuthorizeExchangeSpec.Access
- java.lang.Object
-
- org.springframework.security.config.web.server.ServerHttpSecurity.AuthorizeExchangeSpec.Access
-
- Enclosing class:
- ServerHttpSecurity.AuthorizeExchangeSpec
public final class ServerHttpSecurity.AuthorizeExchangeSpec.Access extends java.lang.ObjectConfigures the access for a particular set of exchanges.
-
-
Constructor Summary
Constructors Constructor Description Access()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerHttpSecurity.AuthorizeExchangeSpecaccess(org.springframework.security.authorization.ReactiveAuthorizationManager<org.springframework.security.web.server.authorization.AuthorizationContext> manager)Allows plugging in a custom authorization strategyServerHttpSecurity.AuthorizeExchangeSpecauthenticated()Require an authenticated userServerHttpSecurity.AuthorizeExchangeSpecdenyAll()Deny access for everyoneServerHttpSecurity.AuthorizeExchangeSpechasAnyAuthority(java.lang.String... authorities)Require any authorityServerHttpSecurity.AuthorizeExchangeSpechasAnyRole(java.lang.String... roles)Require any specific role.ServerHttpSecurity.AuthorizeExchangeSpechasAuthority(java.lang.String authority)Require a specific authority.ServerHttpSecurity.AuthorizeExchangeSpechasIpAddress(java.lang.String ipAddress)Require a specific IP address or range using an IP/Netmask (e.g.ServerHttpSecurity.AuthorizeExchangeSpechasRole(java.lang.String role)Require a specific role.ServerHttpSecurity.AuthorizeExchangeSpecpermitAll()Allow access for anyone
-
-
-
Method Detail
-
permitAll
public ServerHttpSecurity.AuthorizeExchangeSpec permitAll()
Allow access for anyone- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
denyAll
public ServerHttpSecurity.AuthorizeExchangeSpec denyAll()
Deny access for everyone- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
hasRole
public ServerHttpSecurity.AuthorizeExchangeSpec hasRole(java.lang.String role)
Require a specific role. This is a shorcut forhasAuthority(String)- Parameters:
role- the role (i.e. "USER" would require "ROLE_USER")- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
hasAnyRole
public ServerHttpSecurity.AuthorizeExchangeSpec hasAnyRole(java.lang.String... roles)
Require any specific role. This is a shortcut forhasAnyAuthority(String...)- Parameters:
roles- the roles (i.e. "USER" would require "ROLE_USER")- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
hasAuthority
public ServerHttpSecurity.AuthorizeExchangeSpec hasAuthority(java.lang.String authority)
Require a specific authority.- Parameters:
authority- the authority to require (i.e. "USER" would require authority of "USER").- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
hasAnyAuthority
public ServerHttpSecurity.AuthorizeExchangeSpec hasAnyAuthority(java.lang.String... authorities)
Require any authority- Parameters:
authorities- the authorities to require (i.e. "USER" would require authority of "USER").- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
authenticated
public ServerHttpSecurity.AuthorizeExchangeSpec authenticated()
Require an authenticated user- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
hasIpAddress
public ServerHttpSecurity.AuthorizeExchangeSpec hasIpAddress(java.lang.String ipAddress)
Require a specific IP address or range using an IP/Netmask (e.g. 192.168.1.0/24).- Parameters:
ipAddress- the address or range of addresses from which the request must come.- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure - Since:
- 5.7
-
access
public ServerHttpSecurity.AuthorizeExchangeSpec access(org.springframework.security.authorization.ReactiveAuthorizationManager<org.springframework.security.web.server.authorization.AuthorizationContext> manager)
Allows plugging in a custom authorization strategy- Parameters:
manager- the authorization manager to use- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
-