Separate resource id from client id

This commit is contained in:
Dave Syer
2014-08-28 07:58:01 +01:00
parent adaece0889
commit 73d4866362
2 changed files with 7 additions and 1 deletions

View File

@@ -82,7 +82,7 @@ public class CloudfoundryResourceConfiguration {
@Override
public void configure(ResourceServerSecurityConfigurer resources)
throws Exception {
resources.resourceId(resource.getClientId());
resources.resourceId(resource.getResourceId());
}
@Override

View File

@@ -33,6 +33,8 @@ public class CloudfoundryResourceProperties implements Validator {
private String serviceId = "resource";
private String id;
@Value("${vcap.services.${cloudfoundry.resource.serviceId:resource}.credentials.clientId:}")
private String clientId;
@@ -60,4 +62,8 @@ public class CloudfoundryResourceProperties implements Validator {
}
}
}
public String getResourceId() {
return id==null ? clientId : id;
}
}