@Configuration @ConditionalOnClass(value=) @EnableConfigurationProperties public class SecurityAutoConfiguration extends Object
Auto-configuration
for security of a web application or
service. By default everything is secured with HTTP Basic authentication except the
explicitly ignored
paths (defaults to
/css/**, /js/**, /images/**, /**/favicon.ico
). Many aspects of the behavior can be controller with SecurityProperties
via
externalized application properties (or via an bean definition of that type to set the
defaults). The user details for authentication are just placeholders
(username=user,
password=password)
but can easily be customized by providing a bean definition
of type AuthenticationManager
. Also provides audit logging of authentication
events.
The framework Endpoint
s (used to expose application information to operations)
include a sensitive
configuration option which will be
used as a security hint by the filter created here.
Some common simple customizations:
exclude
this configuration.security.basic.enabled: false
WebSecurityConfigurerAdapter
and use HttpSecurity#formLogin()
Modifier and Type | Class and Description |
---|---|
static class |
SecurityAutoConfiguration.AuthenticationManagerConfiguration |
Constructor and Description |
---|
SecurityAutoConfiguration() |
Modifier and Type | Method and Description |
---|---|
WebSecurityConfigurerAdapter |
applicationWebSecurityConfigurerAdapter() |
AuthenticationEventPublisher |
authenticationEventPublisher() |
WebSecurityConfigurerAdapter |
managementWebSecurityConfigurerAdapter() |
SecurityProperties |
securityProperties() |
@Bean(name="org.springframework.actuate.properties.SecurityProperties") @ConditionalOnMissingBean public SecurityProperties securityProperties()
@Bean @ConditionalOnMissingBean public AuthenticationEventPublisher authenticationEventPublisher()
@Bean @ConditionalOnMissingBean(value=org.springframework.boot.actuate.autoconfigure.SecurityAutoConfiguration.ApplicationWebSecurityConfigurerAdapter.class) public WebSecurityConfigurerAdapter applicationWebSecurityConfigurerAdapter()
@Bean @ConditionalOnMissingBean(value=org.springframework.boot.actuate.autoconfigure.SecurityAutoConfiguration.ManagementWebSecurityConfigurerAdapter.class) public WebSecurityConfigurerAdapter managementWebSecurityConfigurerAdapter()
Copyright © 2013. All rights reserved.