Package org.springframework.security.config.annotation.web.configurers

# Class ChannelSecurityConfigurer<H extends HttpSecurityBuilder<H>>

java.lang.Object
org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,B>
org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<ChannelSecurityConfigurer<H>,H>
org.springframework.security.config.annotation.web.configurers.ChannelSecurityConfigurer<H>

Type Parameters:
  `H` - the type of `HttpSecurityBuilder` that is being configured

All Implemented Interfaces:
  `SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H>`

public final class ChannelSecurityConfigurer<H extends HttpSecurityBuilder<H>> extends AbstractHttpConfigurer<ChannelSecurityConfigurer<H>,H>
Adds channel security (i.e. requires HTTPS or HTTP) to an application. In order for `ChannelSecurityConfigurer` to be useful, at least one `RequestMatcher` should be mapped to HTTP or HTTPS.

By default an `InsecureChannelProcessor` and a `SecureChannelProcessor` will be registered.

## Security Filters

The following Filters are populated

- `ChannelProcessingFilter`

## Shared Objects Created

No shared objects are created.

## Shared Objects Used

The following shared objects are used:

- `PortMapper` is used to create the default `ChannelProcessor` instances

Since:
  3.2

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`final class`
`ChannelSecurityConfigurer.ChannelRequestMatcherRegistry`
`class`
`ChannelSecurityConfigurer.RequiresChannelUrl`

## Constructor Summary

Constructors
Constructor
Description
`ChannelSecurityConfigurer(org.springframework.context.ApplicationContext context)`
Creates a new instance

## Method Summary

Modifier and Type
Method
Description
`void`
`configure(H http)`
Configure the `SecurityBuilder` by setting the necessary properties on the `SecurityBuilder`.
`ChannelSecurityConfigurer<H>.ChannelRequestMatcherRegistry`
`getRegistry()`

### Methods inherited from class org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer

`disable, getSecurityContextHolderStrategy, withObjectPostProcessor, withObjectPostProcessor`

### Methods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter

`addObjectPostProcessor, addObjectPostProcessor, and, getBuilder, init, postProcess, setBuilder`

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

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

## Constructor Details

### ChannelSecurityConfigurer

public ChannelSecurityConfigurer(org.springframework.context.ApplicationContext context)
Creates a new instance

See Also:
  - `HttpSecurity.requiresChannel()`

## Method Details

### getRegistry

public ChannelSecurityConfigurer<H>.ChannelRequestMatcherRegistry getRegistry()

### configure

public void configure(H http)
Description copied from interface: `SecurityConfigurer`
Configure the `SecurityBuilder` by setting the necessary properties on the `SecurityBuilder`.

Specified by:
  `configure` in interface `SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>`
Overrides:
  `configure` in class `SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>`