Package org.springframework.security.config.web.server

# Class ServerHttpSecurity.HttpsRedirectSpec

java.lang.Object
org.springframework.security.config.web.server.ServerHttpSecurity.HttpsRedirectSpec

Enclosing class:
  ServerHttpSecurity

public class ServerHttpSecurity.HttpsRedirectSpec extends Object
Configures HTTPS redirection rules

Since:
  5.1
See Also:
  - `ServerHttpSecurity.redirectToHttps()`

## Constructor Summary

Constructors
Constructor
Description
`HttpsRedirectSpec()`

## Method Summary

Modifier and Type
Method
Description
`ServerHttpSecurity`
`and()`
Deprecated, for removal: This API element is subject to removal in a future version.
use `ServerHttpSecurity.redirectToHttps(Customizer)`
`protected void`
`configure(ServerHttpSecurity http)`
`ServerHttpSecurity.HttpsRedirectSpec`
`httpsRedirectWhen(Function<org.springframework.web.server.ServerWebExchange,Boolean> when)`
Configures when this filter should redirect to https By default, the filter will redirect whenever an exchange's scheme is not https
`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
`ServerHttpSecurity.HttpsRedirectSpec`
`portMapper(org.springframework.security.web.PortMapper portMapper)`
Configures a custom HTTPS port to redirect to

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### HttpsRedirectSpec

public HttpsRedirectSpec()

## Method Details

### 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.HttpsRedirectSpec` for additional configuration

### httpsRedirectWhen

public ServerHttpSecurity.HttpsRedirectSpec httpsRedirectWhen(Function<org.springframework.web.server.ServerWebExchange,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.HttpsRedirectSpec` for additional configuration

### portMapper

public ServerHttpSecurity.HttpsRedirectSpec portMapper(org.springframework.security.web.PortMapper portMapper)
Configures a custom HTTPS port to redirect to

Parameters:
  `portMapper` - the `PortMapper` to use
Returns:
  the `ServerHttpSecurity.HttpsRedirectSpec` for additional configuration

### configure

protected void configure(ServerHttpSecurity http)

### and

@Deprecated(since="6.1", forRemoval=true) public ServerHttpSecurity and()
Deprecated, for removal: This API element is subject to removal in a future version.
use `ServerHttpSecurity.redirectToHttps(Customizer)`
Allows method chaining to continue configuring the `ServerHttpSecurity`

Returns:
  the `ServerHttpSecurity` to continue configuring