Class CorsConfigurer<H extends HttpSecurityBuilder<H>>
- java.lang.Object
-
- org.springframework.security.config.annotation.SecurityConfigurerAdapter<DefaultSecurityFilterChain,B>
-
- org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<CorsConfigurer<H>,H>
-
- org.springframework.security.config.annotation.web.configurers.CorsConfigurer<H>
-
- Type Parameters:
H
- the builder to return.
- All Implemented Interfaces:
SecurityConfigurer<DefaultSecurityFilterChain,H>
public class CorsConfigurer<H extends HttpSecurityBuilder<H>> extends AbstractHttpConfigurer<CorsConfigurer<H>,H>
AddsCorsFilter
to the Spring Security filter chain. If a bean by the name of corsFilter is provided, thatCorsFilter
is used. Else if corsConfigurationSource is defined, then thatCorsConfiguration
is used. Otherwise, if Spring MVC is on the classpath aHandlerMappingIntrospector
is used.- Since:
- 4.1.1
-
-
Constructor Summary
Constructors Constructor Description CorsConfigurer()
Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CorsConfigurer<H>
configurationSource(org.springframework.web.cors.CorsConfigurationSource configurationSource)
void
configure(H http)
Configure theSecurityBuilder
by setting the necessary properties on theSecurityBuilder
.-
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, getBuilder, init, postProcess, setBuilder
-
-
-
-
Constructor Detail
-
CorsConfigurer
public CorsConfigurer()
Creates a new instance- See Also:
HttpSecurity.cors()
-
-
Method Detail
-
configurationSource
public CorsConfigurer<H> configurationSource(org.springframework.web.cors.CorsConfigurationSource configurationSource)
-
configure
public void configure(H http)
Description copied from interface:SecurityConfigurer
Configure theSecurityBuilder
by setting the necessary properties on theSecurityBuilder
.- Specified by:
configure
in interfaceSecurityConfigurer<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
- Overrides:
configure
in classSecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
-
-