Pivotal Knowledge Base


Getting Access Token from Spring Cloud Services Instances


Spring Cloud Services


  • Access Spring Cloud Services instances with HTTP REST APIs (For example, eureka APIs).  
  • Use access token for troubleshooting purpose. 

Note: The curl utility must be installed.


1. Find service instance credentials by checking app's VCAP_SERVICES environment variables 'cf env APP_NAME'. Use config server instance as an example.

"credentials": {
"access_token_uri": "https://p-spring-cloud-services.uaa.SYSTEM_DOMAIN/oauth/token",
"client_id": "p-config-server-497b6620-b797-42b7-bbc0-3767faa0199d",
"client_secret": "xxxxxxxx",
"uri": "https://config-GUID.APP_DOMAIN"

2. Obtain access token from Step1's access_token_uri, client_id, and client_secret and supply them as curl parameters, sample below:

$ curl -X POST 'https://p-spring-cloud-services.uaa.SYSTEM_DOMAIN/oauth/token' \
   -d 'grant_type=client_credentials&client_id=p-config-server-497b6620-b797-42b7-bbc0-3767faa0199d&client_secret=gK1BXy8lSaQC'


Additional Information

The token expires in 30 seconds, the new token is required once token expires. 


Powered by Zendesk