|
|
@ -19,6 +19,7 @@ package org.springframework.boot.autoconfigure.security;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
|
|
|
|
|
|
|
import org.springframework.security.config.BeanIds;
|
|
|
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
|
|
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
|
|
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
|
|
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
|
|
|
|
|
|
|
|
|
|
@ -27,14 +28,14 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
|
|
|
|
* {@link EnableWebSecurity} annotation. This will make sure that the annotation is
|
|
|
|
* {@link EnableWebSecurity} annotation. This will make sure that the annotation is
|
|
|
|
* present with default security auto-configuration and also if the user adds custom
|
|
|
|
* present with default security auto-configuration and also if the user adds custom
|
|
|
|
* security and forgets to add the annotation. If {@link EnableWebSecurity} has already
|
|
|
|
* security and forgets to add the annotation. If {@link EnableWebSecurity} has already
|
|
|
|
* been added or if a bean with name springSecurityFilterChain has been configured by the
|
|
|
|
* been added or if a bean with name {@value BeanIds#SPRING_SECURITY_FILTER_CHAIN} has
|
|
|
|
* user, this will back-off.
|
|
|
|
* been configured by the user, this will back-off.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author Madhura Bhave
|
|
|
|
* @author Madhura Bhave
|
|
|
|
* @since 2.0.0
|
|
|
|
* @since 2.0.0
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ConditionalOnBean(WebSecurityConfigurerAdapter.class)
|
|
|
|
@ConditionalOnBean(WebSecurityConfigurerAdapter.class)
|
|
|
|
@ConditionalOnMissingBean(name = "springSecurityFilterChain")
|
|
|
|
@ConditionalOnMissingBean(name = BeanIds.SPRING_SECURITY_FILTER_CHAIN)
|
|
|
|
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
|
|
|
|
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
|
|
|
|
@EnableWebSecurity
|
|
|
|
@EnableWebSecurity
|
|
|
|
public class WebSecurityEnablerConfiguration {
|
|
|
|
public class WebSecurityEnablerConfiguration {
|
|
|
|