Class ServerHttpSecurity.HttpsRedirectSpec
- java.lang.Object
-
- org.springframework.security.config.web.server.ServerHttpSecurity.HttpsRedirectSpec
-
- Enclosing class:
- ServerHttpSecurity
public class ServerHttpSecurity.HttpsRedirectSpec extends java.lang.ObjectConfigures HTTPS redirection rules- Since:
- 5.1
- See Also:
ServerHttpSecurity.redirectToHttps()
-
-
Constructor Summary
Constructors Constructor Description HttpsRedirectSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerHttpSecurityand()Allows method chaining to continue configuring theServerHttpSecurityprotected voidconfigure(ServerHttpSecurity http)ServerHttpSecurity.HttpsRedirectSpechttpsRedirectWhen(java.util.function.Function<org.springframework.web.server.ServerWebExchange,java.lang.Boolean> when)Configures when this filter should redirect to https By default, the filter will redirect whenever an exchange's scheme is not httpsServerHttpSecurity.HttpsRedirectSpechttpsRedirectWhen(org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher... matchers)Configures when this filter should redirect to https By default, the filter will redirect whenever an exchange's scheme is not httpsServerHttpSecurity.HttpsRedirectSpecportMapper(org.springframework.security.web.PortMapper portMapper)Configures a custom HTTPS port to redirect to
-
-
-
Method Detail
-
httpsRedirectWhen
public ServerHttpSecurity.HttpsRedirectSpec httpsRedirectWhen(org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher... matchers)
Configures when this filter should redirect to https By default, the filter will redirect whenever an exchange's scheme is not https- Parameters:
matchers- the list of conditions that, when any are met, the filter should redirect to https- Returns:
- the
ServerHttpSecurity.HttpsRedirectSpecfor additional configuration
-
httpsRedirectWhen
public ServerHttpSecurity.HttpsRedirectSpec httpsRedirectWhen(java.util.function.Function<org.springframework.web.server.ServerWebExchange,java.lang.Boolean> when)
Configures when this filter should redirect to https By default, the filter will redirect whenever an exchange's scheme is not https- Parameters:
when- determines when to redirect to https- Returns:
- the
ServerHttpSecurity.HttpsRedirectSpecfor additional configuration
-
portMapper
public ServerHttpSecurity.HttpsRedirectSpec portMapper(org.springframework.security.web.PortMapper portMapper)
Configures a custom HTTPS port to redirect to- Parameters:
portMapper- thePortMapperto use- Returns:
- the
ServerHttpSecurity.HttpsRedirectSpecfor additional configuration
-
configure
protected void configure(ServerHttpSecurity http)
-
and
public ServerHttpSecurity and()
Allows method chaining to continue configuring theServerHttpSecurity- Returns:
- the
ServerHttpSecurityto continue configuring
-
-