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

How to authenticate Cloud Platform API

tobias_mitter2
Explorer
4,445

Hello,

we want to use the cloud foundry platform api (http://v3-apidocs.cloudfoundry.org/version/3.81.0/index.html) to do some automation.

The API is OAuth2 protected. In order to authenticate, we would need to create an oauth client and use the credentials to get a token. We did not find any way to do that.

How can we access the api?

There is one way for testing we found, as according to the cloud foundry documentation you can get an oauth token with the CLI command "cf oauth-token". That is the only way we found to actually being able to call the api, but this is only ok for some quick testing, but for a live scenario we need a REST way to get a token.

Cloud Foundry documentation describes some way to create a client, but this does not work on SAP Cloud Foundry, as we don't have access to tools and infrastructure.

Thanks and regards,

Tobias

View Entire Topic
tobias_mitter2
Explorer
0 Likes

So I am going to answer this myself. It seems there is no solution yet, but there is one coming.

See this: https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/3670474a58c24ac2b082e76cbbd...

Just stumbled over it by accident. When I look at the supported scopes though, it seems it is only a part of the whole api. It doesn't even say which api (v2 or v3), it might even be that SAP is building a facade around it...have to check it out some time. Hope this helps.

mike_zaschka
Active Participant
0 Likes

Hi tobias.mitter2,

did you find a solution in the meantime?
I am stuck with the same problem. The token obtained from the CLI (cf oauth-token) is working fine to access the Cloud Controller API (v2 and v3), but I am not able to get a valid access-token from any authorization endpoint, including the Cloud Management Service.

Kind Regards,

Mike

tobias_mitter2
Explorer

Hello Mike, as we are still not on feature set b, we could not move forward here. Regards, Tobias