From cd896917266f161720bda304d16b99a777c3f4e1 Mon Sep 17 00:00:00 2001 From: Christian Dupuis Date: Thu, 21 Nov 2013 18:04:57 +0100 Subject: [PATCH] Pin order to of crsh auto configuration to happen after any security related configuration If crsh auto configuration happens too early a AuthenticationManager contributed by SecurityAutoConfiguration will not be detected --- .../boot/actuate/autoconfigure/CrshAutoConfiguration.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java index f10d74ab80..b4c052a311 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java @@ -58,6 +58,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -119,7 +120,8 @@ import org.springframework.util.StringUtils; @Configuration @ConditionalOnClass({ PluginLifeCycle.class }) @EnableConfigurationProperties({ ShellProperties.class }) -@AutoConfigureAfter(ManagementSecurityAutoConfiguration.class) +@AutoConfigureAfter({ SecurityAutoConfiguration.class, + ManagementSecurityAutoConfiguration.class }) public class CrshAutoConfiguration { @Autowired @@ -182,7 +184,8 @@ public class CrshAutoConfiguration { @ConditionalOnMissingBean({ CrshShellAuthenticationProperties.class }) public CrshShellAuthenticationProperties springAuthenticationProperties() { // In case no shell.auth property is provided fall back to Spring Security - // based authentication and get role to access shell from SecurityProperties. + // based authentication and get role to access shell from + // ManagementServerProperties. SpringAuthenticationProperties authenticationProperties = new SpringAuthenticationProperties(); if (this.management != null) { authenticationProperties.setRoles(new String[] { this.management