Class PortMapperConfigurer<H extends HttpSecurityBuilder<H>>
- java.lang.Object
-
- org.springframework.security.config.annotation.SecurityConfigurerAdapter<DefaultSecurityFilterChain,B>
-
- org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<PortMapperConfigurer<H>,H>
-
- org.springframework.security.config.annotation.web.configurers.PortMapperConfigurer<H>
-
- All Implemented Interfaces:
SecurityConfigurer<DefaultSecurityFilterChain,H>
public final class PortMapperConfigurer<H extends HttpSecurityBuilder<H>> extends AbstractHttpConfigurer<PortMapperConfigurer<H>,H>
Allows configuring a sharedPortMapper
instance used to determine the ports when redirecting between HTTP and HTTPS. ThePortMapper
can be obtained fromAbstractConfiguredSecurityBuilder.getSharedObject(Class)
.- Since:
- 3.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
PortMapperConfigurer.HttpPortMapping
Allows specifying the HTTPS port for a given HTTP port when redirecting between HTTP and HTTPS.
-
Constructor Summary
Constructors Constructor Description PortMapperConfigurer()
Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PortMapperConfigurer.HttpPortMapping
http(int httpPort)
Adds a port mappingvoid
init(H http)
Initialize theSecurityBuilder
.PortMapperConfigurer<H>
portMapper(PortMapper portMapper)
Allows specifying thePortMapper
instance.-
Methods inherited from class org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer
disable, withObjectPostProcessor
-
Methods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, and, configure, getBuilder, postProcess, setBuilder
-
-
-
-
Method Detail
-
portMapper
public PortMapperConfigurer<H> portMapper(PortMapper portMapper)
Allows specifying thePortMapper
instance.- Parameters:
portMapper
-- Returns:
- the
PortMapperConfigurer
for further customizations
-
http
public PortMapperConfigurer.HttpPortMapping http(int httpPort)
Adds a port mapping- Parameters:
httpPort
- the HTTP port that maps to a specific HTTPS port.- Returns:
PortMapperConfigurer.HttpPortMapping
to define the HTTPS port
-
init
public void init(H http)
Description copied from interface:SecurityConfigurer
Initialize theSecurityBuilder
. Here only shared state should be created and modified, but not properties on theSecurityBuilder
used for building the object. This ensures that theSecurityConfigurer.configure(SecurityBuilder)
method uses the correct shared objects when building. Configurers should be applied here.- Specified by:
init
in interfaceSecurityConfigurer<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
- Overrides:
init
in classSecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
-
-