From 5c0ef308aad14107bba535799134d0222a70a783 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Wed, 28 Oct 2015 11:50:31 +0000 Subject: [PATCH] Test that client-id can be hyphen or camel-cased --- .../oauth2/resource/OAuth2ResourceServerConfiguration.java | 2 +- .../ResourceServerTokenServicesConfigurationTests.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerConfiguration.java index efd0b84ee4..476ec84b56 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerConfiguration.java @@ -115,7 +115,7 @@ public class OAuth2ResourceServerConfiguration { RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(environment, "security.oauth2.resource."); String client = environment - .resolvePlaceholders("${security.oauth2.client.clientId:}"); + .resolvePlaceholders("${security.oauth2.client.client-id:}"); if (StringUtils.hasText(client)) { return ConditionOutcome.match("found client id"); } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerTokenServicesConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerTokenServicesConfigurationTests.java index a851e2e0a7..6b65f2fd13 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerTokenServicesConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerTokenServicesConfigurationTests.java @@ -21,7 +21,6 @@ import java.util.Map; import org.junit.After; import org.junit.Test; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionRegistry; @@ -122,9 +121,9 @@ public class ResourceServerTokenServicesConfigurationTests { } @Test - public void userInfoNoClient() { + public void userInfoWithClient() { EnvironmentTestUtils.addEnvironment(this.environment, - "security.oauth2.client.clientId=acme", + "security.oauth2.client.client-id=acme", "security.oauth2.resource.userInfoUri:http://example.com", "server.port=-1", "debug=true"); this.context = new SpringApplicationBuilder(ResourceNoClientConfiguration.class)