• Dave Syer's avatar
    Register an AuthenticationManager in security autoconfig · 3d437711
    Dave Syer authored
    This is quite a big step, but I think it helps a lot. Since Spring
    Boot always creates an AuthenticationManager if it doesn't find one
    already registered, it makes sense to also make it into a @Bean.
    Spring Security does not register its AuthenticationManager by
    default though, so we have to do that for it if the user has created
    one with an @Autowired AuthenticationManagerBuilder, but not registered
    it as a @Bean.
    
    Having the @Bean (marked @Primary to prevent issues with @Autowired)
    makes it easier to reason about what Spring Boot has done for you, and
    easier to default in simple use cases to the boot-created
    AuthenticationManager. For example, if I want an OAuth2 Authorization
    Server with password grant, it makes total sense for the
    AuthenticationManager for users to be the same as the @Primary one.
    Now it is easy to set that up (just @Autowire it).
    3d437711
Name
Last commit
Last update
docs Loading commit data...
eclipse Loading commit data...
spring-boot Loading commit data...
spring-boot-actuator Loading commit data...
spring-boot-autoconfigure Loading commit data...
spring-boot-cli Loading commit data...
spring-boot-dependencies Loading commit data...
spring-boot-docs Loading commit data...
spring-boot-full-build Loading commit data...
spring-boot-integration-tests Loading commit data...
spring-boot-parent Loading commit data...
spring-boot-samples Loading commit data...
spring-boot-starters Loading commit data...
spring-boot-tools Loading commit data...
.gitignore Loading commit data...
.settings-template.xml Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
README.md Loading commit data...
pom.xml Loading commit data...