Class WebSecurityConfiguration
- java.lang.Object
-
- org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.context.annotation.ImportAware
@Configuration(proxyBeanMethods=false) public class WebSecurityConfiguration extends java.lang.Object implements org.springframework.context.annotation.ImportAware, org.springframework.beans.factory.BeanClassLoaderAware
Uses aWebSecurity
to create theFilterChainProxy
that performs the web based security for Spring Security. It then exports the necessary beans. Customizations can be made toWebSecurity
by extendingWebSecurityConfigurerAdapter
and exposing it as aConfiguration
or implementingWebSecurityConfigurer
and exposing it as aConfiguration
. This configuration is imported when usingEnableWebSecurity
.- Since:
- 3.2
- See Also:
EnableWebSecurity
,WebSecurity
-
-
Constructor Summary
Constructors Constructor Description WebSecurityConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AutowiredWebSecurityConfigurersIgnoreParents
autowiredWebSecurityConfigurersIgnoreParents(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
static org.springframework.beans.factory.config.BeanFactoryPostProcessor
conversionServicePostProcessor()
static DelegatingApplicationListener
delegatingApplicationListener()
WebInvocationPrivilegeEvaluator
privilegeEvaluator()
Creates theWebInvocationPrivilegeEvaluator
that is necessary to evaluate privileges for a given web URIvoid
setBeanClassLoader(java.lang.ClassLoader classLoader)
void
setFilterChainProxySecurityConfigurer(ObjectPostProcessor<java.lang.Object> objectPostProcessor, java.util.List<SecurityConfigurer<javax.servlet.Filter,WebSecurity>> webSecurityConfigurers)
Sets the<SecurityConfigurer<FilterChainProxy, WebSecurityBuilder>
instances used to create the web configuration.void
setImportMetadata(org.springframework.core.type.AnnotationMetadata importMetadata)
javax.servlet.Filter
springSecurityFilterChain()
Creates the Spring Security Filter ChainSecurityExpressionHandler<FilterInvocation>
webSecurityExpressionHandler()
-
-
-
Method Detail
-
delegatingApplicationListener
@Bean public static DelegatingApplicationListener delegatingApplicationListener()
-
webSecurityExpressionHandler
@Bean @DependsOn("springSecurityFilterChain") public SecurityExpressionHandler<FilterInvocation> webSecurityExpressionHandler()
-
springSecurityFilterChain
@Bean(name="springSecurityFilterChain") public javax.servlet.Filter springSecurityFilterChain() throws java.lang.Exception
Creates the Spring Security Filter Chain- Returns:
- the
Filter
that represents the security filter chain - Throws:
java.lang.Exception
-
privilegeEvaluator
@Bean @DependsOn("springSecurityFilterChain") public WebInvocationPrivilegeEvaluator privilegeEvaluator()
Creates theWebInvocationPrivilegeEvaluator
that is necessary to evaluate privileges for a given web URI- Returns:
- the
WebInvocationPrivilegeEvaluator
-
setFilterChainProxySecurityConfigurer
@Autowired(required=false) public void setFilterChainProxySecurityConfigurer(ObjectPostProcessor<java.lang.Object> objectPostProcessor, @Value("#{@autowiredWebSecurityConfigurersIgnoreParents.getWebSecurityConfigurers()}") java.util.List<SecurityConfigurer<javax.servlet.Filter,WebSecurity>> webSecurityConfigurers) throws java.lang.Exception
Sets the<SecurityConfigurer<FilterChainProxy, WebSecurityBuilder>
instances used to create the web configuration.- Parameters:
objectPostProcessor
- theObjectPostProcessor
used to create aWebSecurity
instancewebSecurityConfigurers
- the<SecurityConfigurer<FilterChainProxy, WebSecurityBuilder>
instances used to create the web configuration- Throws:
java.lang.Exception
-
conversionServicePostProcessor
@Bean public static org.springframework.beans.factory.config.BeanFactoryPostProcessor conversionServicePostProcessor()
-
autowiredWebSecurityConfigurersIgnoreParents
@Bean public static AutowiredWebSecurityConfigurersIgnoreParents autowiredWebSecurityConfigurersIgnoreParents(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
-
setImportMetadata
public void setImportMetadata(org.springframework.core.type.AnnotationMetadata importMetadata)
- Specified by:
setImportMetadata
in interfaceorg.springframework.context.annotation.ImportAware
-
setBeanClassLoader
public void setBeanClassLoader(java.lang.ClassLoader classLoader)
- Specified by:
setBeanClassLoader
in interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
-