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 shared
PortMapper instance used to determine the ports
when redirecting between HTTP and HTTPS. The PortMapper can be obtained from
AbstractConfiguredSecurityBuilder.getSharedObject(Class).- Since:
- 3.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classAllows specifying the HTTPS port for a given HTTP port when redirecting between HTTP and HTTPS. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhttp(int httpPort) Adds a port mappingvoidInitialize theSecurityBuilder.portMapper(PortMapper portMapper) Allows specifying thePortMapperinstance.Methods inherited from class org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer
disable, getSecurityContextHolderStrategy, withObjectPostProcessor, withObjectPostProcessorMethods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, addObjectPostProcessor, and, configure, getBuilder, postProcess, setBuilder
-
Constructor Details
-
PortMapperConfigurer
public PortMapperConfigurer()Creates a new instance
-
-
Method Details
-
portMapper
Allows specifying thePortMapperinstance.- Parameters:
portMapper-- Returns:
- the
PortMapperConfigurerfor further customizations
-
http
Adds a port mapping- Parameters:
httpPort- the HTTP port that maps to a specific HTTPS port.- Returns:
PortMapperConfigurer<H extends HttpSecurityBuilder<H>>.HttpPortMappingto define the HTTPS port
-
init
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<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>> - Overrides:
initin classSecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
-