cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to access Cloud Foundry Controller API?

former_member184876
Active Participant
7,289

Hi Community,

After working for quite some time on the Cloud Foundry CLI and SAP Cloud Platform Cockpit, i was thinking how to access Cloud Foundry using Cloud Foundry API.

I explored little bit, but have hard time to understand how to authenticate to CF API using postman.

https://api.cf.eu10.hana.ondemand.com/

Need your advice on how i can get access token to access different Cloud Foundry APIs form Postman?

Thank you in advance,

Venu

View Entire Topic
tobias_mitter2
Explorer
0 Likes

Hi Venu,

I had basically the same question a few days ago.

https://answers.sap.com/questions/13004003/how-to-authenticate-cloud-platform-api.html

Didn't get a response until now. You can get a token with cli and use it in postman to access the api. It works well, I can use the whole range of apis (http://v3-apidocs.cloudfoundry.org/version/3.81.0/index.html). It is just that I can not find a way to authenticate in a REST way (without CLI). So it is really frustrating.

Best regards,

Tobias

former_member184876
Active Participant
0 Likes

Hi Tobias,

Thanks for your response and pointing to your question. Yes. The token form CF CLI is working. But the JWT from XSUAA service instance (received through application binding) is rejected by Cloud Foundry API. Not sure if there is a way to access CF API through applicaitons.

Thank you,

Venu

tobias_mitter2
Explorer

Yes I tried every conceivable way...

Until just recently we had the same problem with the XSUAA API. There was also no way to use it until SAP finally released a "fix". Now you can create a XSUAA Instance with a special api service plan. When creating a service key for that instance you could finally get a working client_id and client_secret to access the api. The CF documentation mentions one can use the CF UAA to get a token to use the plattform api and by using the access to XSUAA I tried to create a oauth client, but also didn't succeed. For the plattform api, you need specific authorizations (scopes) which xsuaa doesn't give you.

I just cannot image, why on earth we are the only ones who would like to use this api. It is absolutely necessary for an operation team.

gregorw
SAP Mentor
SAP Mentor

With your reminder for the service plan apiaccess I was able to find the documentation Enable API Access to an XSUAA Configuration.