Activate WebSecurityEnabler only for web applications

Done in order to align with the rest of the configuration. Absent this
check, the bean will be installed in non-web applications without the
corresponding dependencies, causing the bootstrap to fail.

Closes gh-1588
This commit is contained in:
Marius Bogoevici 2014-09-19 16:04:42 -04:00 committed by Andy Wilkinson
parent a8af254765
commit 5c84e17d10

View File

@ -165,6 +165,7 @@ public class ManagementSecurityAutoConfiguration {
@Configuration
@ConditionalOnExpression("${management.security.enabled:true} && !${security.basic.enabled:true}")
@ConditionalOnMissingBean(WebSecurityConfiguration.class)
@ConditionalOnWebApplication
@EnableWebSecurity
protected static class WebSecurityEnabler extends AuthenticationManagerConfiguration {
}