Fix oauth2 resource jwt keyUri property location

Fixes gh-11
This commit is contained in:
Sebastien Bortolussi
2016-02-03 17:59:38 +01:00
committed by Dave Syer
parent 34c7f0c0f9
commit d8aa50eb85
2 changed files with 11 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ implements EnvironmentPostProcessor, Ordered {
if (authDomain != null) {
source.put("security.oauth2.resource.userInfoUri",
authDomain + "/userinfo");
source.put("security.oauth2.resource.keyUri", authDomain + "/token_key");
source.put("security.oauth2.resource.jwt.keyUri", authDomain + "/token_key");
source.put("security.oauth2.client.accessTokenUri",
authDomain + "/oauth/token");
source.put("security.oauth2.client.userAuthorizationUri",
@@ -75,7 +75,7 @@ implements EnvironmentPostProcessor, Ordered {
else {
addProperty(source, resolver, serviceId, "resource", "userInfoUri");
addProperty(source, resolver, serviceId, "resource", "tokenInfoUri");
addProperty(source, resolver, serviceId, "resource", "keyUri");
addProperty(source, resolver, serviceId, "resource.jwt", "keyUri");
addProperty(source, resolver, serviceId, "resource", "keyValue");
addProperty(source, resolver, serviceId, "client", "accessTokenUri", "tokenUri");
addProperty(source, resolver, serviceId, "client", "userAuthorizationUri", "authorizationUri");

View File

@@ -100,4 +100,13 @@ public class VcapServiceCredentialsEnvironmentPostProcessorTests {
.resolvePlaceholders("${security.oauth2.client.accessTokenUri}"));
}
@Test
public void addJwtKeyUri() {
EnvironmentTestUtils.addEnvironment(this.environment,
"vcap.services.sso.credentials.keyUri:http://example.com");
this.listener.postProcessEnvironment(this.environment, new SpringApplication());
assertEquals("http://example.com", this.environment
.resolvePlaceholders("${security.oauth2.resource.jwt.keyUri}"));
}
}