Using the Login server API Endpoint , retrieve the CF auth token. Make sure to set the region based on the IBM Cloud region where the CF applications are being deployed
https://iam.cloud.ibm.com/cloudfoundry/login/<REGION>/oauth/token'
Example command
curl -u "cf:" -X POST '<REPLACE_LOGIN_SERVER_API_ENDPOINT> ' --data-urlencode 'grant_type=password' --data-urlencode 'username=apikey' --data-urlencode 'password=<API_KEY_Value>'
Replace the REPLACE_LOGIN_SERVER_API_ENDPOINT with following entry for region us-south and replace the API Key value for the password
Example:
curl -u "cf:" -X POST 'https://iam.cloud.ibm.com/cloudfoundry/login/us-south/oauth/token' --data-urlencode 'grant_type=password' --data-urlencode 'username=apikey' --data-urlencode 'password=xxxxxxxxxxxxxxx'
Set Authorization header:
Basic-Auth:
username : “cf:"
Set Body Parameters:
'grant_type=password'
'username=apikey’
'password=<API_KEY_Value>'