Detect springSecurityFilterChain using name
This commit is contained in:
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package org.springframework.boot.autoconfigure.security;
|
package org.springframework.boot.autoconfigure.security;
|
||||||
|
|
||||||
import javax.servlet.Filter;
|
|
||||||
|
|
||||||
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;
|
||||||
@@ -29,14 +27,14 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
|
|||||||
* {@link EnableWebSecurity} annotation. This will make
|
* {@link EnableWebSecurity} annotation. This will make
|
||||||
* sure that the annotation is present with default security auto-configuration and also
|
* sure that the annotation is present with default security auto-configuration and also
|
||||||
* if the user adds custom security and forgets to add the annotation. If {@link EnableWebSecurity}
|
* if the user adds custom security and forgets to add the annotation. If {@link EnableWebSecurity}
|
||||||
* has already been added or if a {@link Filter} with name springSecurityFilterChain
|
* has already been added or if a bean with name springSecurityFilterChain
|
||||||
* has been configured by the user, this will back-off.
|
* has 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(value = Filter.class, name = "springSecurityFilterChain")
|
@ConditionalOnMissingBean(name = "springSecurityFilterChain")
|
||||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
|
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
public class WebSecurityEnablerConfiguration {
|
public class WebSecurityEnablerConfiguration {
|
||||||
|
|||||||
Reference in New Issue
Block a user