Re: how to get cf authentication token programmatically


Zuba Al <myfakename90@...>
 

Actually my app needs to get info of other apps running in same cf api domain. To get this info, I'm calling APIs of other apps using HTTP.GETrequest with authentication token in request header. And to get this authentication token, I'm using HTTP:POST request to 'AuthorizationURL/oauth/token' with username and password in the request header.
1.CF environment variables doesn't have all the info needed and so I'm calling app's API directly and getting needed info from the returned JSON.
2. There is a config.json file in my local system in "C:\Users\MyUser\.cf" path and has cf target api and auth token, but it gets populated only when I'm logged into cf in command line. My app once deployed and running in cf, should get the info of other apps even if I'm not logged in. So getting auth token from local system's config.json is not a good idea.

Please suggest me another way to get auth token.

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.