Search code examples
oauth-2.0restful-authenticationcloud-foundry

How to get token using Cloud Foundry api?


I'm trying to get token from Cloud Foundry. I'm getting token from cf oauth-token command but I try using curl its giving me an error:

{
  "description": "Unknown request",
  "error_code": "CF-NotFound",
  "code": 10000
}  

The Curl command I'm using:

curl 'https://<domian>/oauth/token' -X POST \
        -H 'Content-Type: application/x-www-form-urlencoded' \
        -H 'Accept: application/json

What am I doing wrong?


Solution

  • It depends on used flow. See doc: https://docs.cloudfoundry.org/api/uaa/version/4.31.0/index.html#authorization