Skip to Content
1
Mar 17, 2020 at 06:52 AM

How to authenticate Cloud Platform API

878 Views

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