@Configuration @ConditionalOnClass(value=) @EnableConfigurationProperties @Import(value={SpringBootWebSecurityConfiguration.class,AuthenticationManagerConfiguration.class}) public class SecurityAutoConfiguration extends Object
Auto-configuration
for Spring Security. Provides an
AuthenticationManager
based on configuration bound to a
SecurityProperties
bean. There is one user (named "user") whose password is
random and printed on the console at INFO level during startup. In a webapp this
configuration also secures all web endpoints (except some well-known static resource)
locations with HTTP basic security. To replace all the default behaviour in a webapp
provide a @Configuration
with @EnableWebSecurity
. To just add
your own layer of application security in front of the defaults, add a
@Configuration
of type WebSecurityConfigurerAdapter
.Constructor and Description |
---|
SecurityAutoConfiguration() |
Modifier and Type | Method and Description |
---|---|
static void |
authentication(AuthenticationManagerBuilder builder,
SecurityProperties security)
Convenience method for building the default AuthenticationManager from
SecurityProperties.
|
AuthenticationManager |
authenticationManager(AuthenticationManagerBuilder builder,
|
SecurityProperties |
securityProperties() |
@Bean @ConditionalOnMissingBean public SecurityProperties securityProperties()
@Bean @ConditionalOnBean(value=) @ConditionalOnMissingBean public AuthenticationManager authenticationManager(AuthenticationManagerBuilder builder, processor) throws Exception
Exception
public static void authentication(AuthenticationManagerBuilder builder, SecurityProperties security) throws Exception
builder
- the AuthenticationManagerBuilder to usesecurity
- the SecurityProperties in useException
Copyright © 2014. All rights reserved.