Class ServerHttpSecurity.AuthorizeExchangeSpec.Access
java.lang.Object
org.springframework.security.config.web.server.ServerHttpSecurity.AuthorizeExchangeSpec.Access
- Enclosing class:
- ServerHttpSecurity.AuthorizeExchangeSpec
Configures the access for a particular set of exchanges.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAllows plugging in a custom authorization strategyRequire an authenticated userdenyAll()Deny access for everyonehasAnyAuthority(String... authorities) Require any authorityhasAnyRole(String... roles) Require any specific role.hasAuthority(String authority) Require a specific authority.hasIpAddress(String ipAddress) Require a specific IP address or range using an IP/Netmask (e.g.Require a specific role.Allow access for anyone
-
Constructor Details
-
Access
public Access()
-
-
Method Details
-
permitAll
Allow access for anyone- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
denyAll
Deny access for everyone- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
hasRole
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
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
Require a specific authority.- Parameters:
authority- the authority to require (i.e. "USER" would require authority of "USER").- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
hasAnyAuthority
Require any authority- Parameters:
authorities- the authorities to require (i.e. "USER" would require authority of "USER").- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
authenticated
Require an authenticated user- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-
hasIpAddress
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(ReactiveAuthorizationManager<AuthorizationContext> manager) Allows plugging in a custom authorization strategy- Parameters:
manager- the authorization manager to use- Returns:
- the
ServerHttpSecurity.AuthorizeExchangeSpecto configure
-