Class PortMapperConfigurer<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<PortMapperConfigurer<H>,H>
-
- org.springframework.security.config.annotation.web.configurers.PortMapperConfigurer<H>
-
- All Implemented Interfaces:
SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H>
public final class PortMapperConfigurer<H extends HttpSecurityBuilder<H>> extends AbstractHttpConfigurer<PortMapperConfigurer<H>,H>
Allows configuring a sharedPortMapperinstance used to determine the ports when redirecting between HTTP and HTTPS. ThePortMappercan be obtained fromAbstractConfiguredSecurityBuilder.getSharedObject(Class).- Since:
- 3.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classPortMapperConfigurer.HttpPortMappingAllows 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.HttpPortMappinghttp(int httpPort)Adds a port mappingvoidinit(H http)Initialize theSecurityBuilder.PortMapperConfigurer<H>portMapper(org.springframework.security.web.PortMapper portMapper)Allows specifying thePortMapperinstance.-
Methods inherited from class org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer
disable, getSecurityContextHolderStrategy, withObjectPostProcessor
-
Methods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, and, configure, getBuilder, postProcess, setBuilder
-
-
-
-
Method Detail
-
portMapper
public PortMapperConfigurer<H> portMapper(org.springframework.security.web.PortMapper portMapper)
Allows specifying thePortMapperinstance.- Parameters:
portMapper-- Returns:
- the
PortMapperConfigurerfor 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.HttpPortMappingto define the HTTPS port
-
init
public void init(H http)
Description copied from interface:SecurityConfigurerInitialize theSecurityBuilder. Here only shared state should be created and modified, but not properties on theSecurityBuilderused 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:
initin interfaceSecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>- Overrides:
initin classSecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
-
-