Change oauth2.* to spring.oauth2.*

This commit is contained in:
Dave Syer
2015-01-14 14:35:16 +00:00
parent 2a6ec08f35
commit fb0e3eace3
2 changed files with 29 additions and 27 deletions

View File

@@ -45,42 +45,42 @@ public class VcapServiceCredentialsListener implements
Map<String, Object> source = new HashMap<String, Object>();
source.put("oauth.sso.logoutUri",
"${vcap.services.${oauth2.sso.serviceId:sso}.credentials.logoutUri:}");
source.put("oauth2.resource.id",
source.put("spring.oauth2.resource.id",
"${vcap.services.${oauth2.resource.serviceId:resource}.credentials.id:}");
source.put(
"oauth2.resource.userInfoUri",
"spring.oauth2.resource.userInfoUri",
"${vcap.services.${oauth2.resource.serviceId:resource}.credentials.userInfoUri:"
+ "${vcap.services.${oauth2.sso.serviceId:sso}.credentials.userInfoUri:}}");
source.put(
"oauth2.resource.tokenInfoUri",
"spring.oauth2.resource.tokenInfoUri",
"${vcap.services.${oauth2.resource.serviceId:resource}.credentials.tokenInfoUri:"
+ "${vcap.services.${oauth2.sso.serviceId:sso}.credentials.tokenInfoUri:}}");
source.put(
"oauth2.resource.jwt.keyUri",
"spring.oauth2.resource.jwt.keyUri",
"${vcap.services.${oauth2.resource.serviceId:resource}.credentials.keyUri:"
+ "${vcap.services.${oauth2.sso.serviceId:sso}.credentials.keyUri:}}");
source.put(
"oauth2.resource.jwt.keyValue",
"spring.oauth2.resource.jwt.keyValue",
"${vcap.services.${oauth2.resource.serviceId:resource}.credentials.keyValue:"
+ "${vcap.services.${oauth2.sso.serviceId:sso}.credentials.keyValue:}}");
source.put(
"oauth2.client.tokenUri",
"spring.oauth2.client.tokenUri",
"${vcap.services.${oauth2.sso.serviceId:sso}.credentials.tokenUri:"
+ "${vcap.services.${oauth2.resource.serviceId:resource}.credentials.tokenUri:}}");
source.put(
"oauth2.client.authorizationUri",
"spring.oauth2.client.authorizationUri",
"${vcap.services.${oauth2.sso.serviceId:sso}.credentials.authorizationUri:"
+ "${vcap.services.${oauth2.resource.serviceId:resource}.credentials.authorizationUri:}}");
source.put(
"oauth2.client.clientId",
"spring.oauth2.client.clientId",
"${vcap.services.${oauth2.sso.serviceId:sso}.credentials.clientId:"
+ "${vcap.services.${oauth2.resource.serviceId:resource}.credentials.clientId:}}");
source.put(
"oauth2.client.clientSecret",
"spring.oauth2.client.clientSecret",
"${vcap.services.${oauth2.sso.serviceId:sso}.credentials.clientSecret:"
+ "${vcap.services.${oauth2.resource.serviceId:resource}.credentials.clientSecret:}}");
source.put(
"oauth2.client.scope",
"spring.oauth2.client.scope",
"${vcap.services.${oauth2.sso.serviceId:sso}.credentials.scope:"
+ "${vcap.services.${oauth2.resource.serviceId:resource}.credentials.scope:}}");
event.getEnvironment().getPropertySources()

View File

@@ -12,12 +12,13 @@ management:
eureka:
server:
enabled: false
oauth2:
sso:
tokenUri: http://localhost:8080/uaa/oauth/token
authorizationUri: http://localhost:8080/uaa/oauth/authorize
clientId: app
clientSecret: appclientsecret
spring:
oauth2:
sso:
tokenUri: http://localhost:8080/uaa/oauth/token
authorizationUri: http://localhost:8080/uaa/oauth/authorize
clientId: app
clientSecret: appclientsecret
logging:
level:
com.netflix.discovery: 'OFF'
@@ -26,15 +27,16 @@ logging:
---
spring:
profiles: github
oauth2:
sso:
tokenUri: https://github.com/login/oauth/access_token
authorizationUri: https://github.com/login/oauth/authorize
clientId: bd1c0a783ccdd1c9b9e4
clientSecret: 1a9030fbca47a5b2c28e92f19050bb77824b5ad1
authenticationScheme: form
resource:
clientId: ${oauth2.sso.clientId}
userInfoUri: https://api.github.com/user
preferTokenInfo: false
spring:
oauth2:
sso:
tokenUri: https://github.com/login/oauth/access_token
authorizationUri: https://github.com/login/oauth/authorize
clientId: bd1c0a783ccdd1c9b9e4
clientSecret: 1a9030fbca47a5b2c28e92f19050bb77824b5ad1
authenticationScheme: form
resource:
clientId: ${oauth2.sso.clientId}
userInfoUri: https://api.github.com/user
preferTokenInfo: false