Access token API always return 404 on C8 trial cluster

hi all,

I am a newbie on C8 and setup a trail cluster and run my model. Retrieved all cliendId and credentials from API console page. Finally, trial run a cluster on C8.

And facing an “access token API always return 404” issue. I already tried to remove the cluster and re-generate a new set of cliendId & credential, but still facing the 404 NOT FOUND issue as same as this guy faced, link on stackoverflow

  1. I follow the npm package document and set up the script for run npm start

/Users//workspace/camunda8-sdk-demo/node_modules/got/dist/source/as-promise/index.js:119
request._beforeError(new types_1.HTTPError(response));
^
HTTPError: Response code 404 (Not Found)
at Request. (/Users//workspace/camunda8-sdk-demo/node_modules/got/dist/source/as-promise/index.js:119:42)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: ‘ERR_NON_2XX_3XX_RESPONSE’,
timings: {
start: 1700740795108,
socket: 1700740795109,
lookup: 1700740795110,
connect: 1700740795272,
secureConnect: 1700740795298,
upload: 1700740795298,
response: 1700740795395,
end: 1700740795399,
error: undefined,
abort: undefined,
phases: {
wait: 1,
dns: 1,
tcp: 162,
tls: 26,
request: 0,
firstByte: 97,
download: 4,
total: 291
}
}
}

When I console.log out the request from this file
/Users//workspace/camunda8-sdk-demo/node_modules/got/dist/source/as-promise/index.js:119
// url: ‘https://login.cloud.camunda.io/oauth/token’,
// method: null,
// statusCode: 404,
// statusMessage: ‘Not Found’,

  1. Console API clients (REST) | Camunda 8 Docs
    curl --header “Content-Type: application/json”
    –request POST
    –data ‘{“grant_type”:“client_credentials”, “audience”:“api.cloud.camunda.io”, “client_id”:“XXX”, “client_secret”:“YYY”}’
    https://login.cloud.camunda.io/oauth/token

// Returned nothing

  1. https://login.cloud.camunda.io/oauth/token POST call by postman

    {
    “grant_type”: “client_credentials”,
    “audience”: “api.cloud.camunda.io”,
    “client_id”: “XXX”,
    “client_secret”: “YYY”
    }
    Return 404 not found

When you created your client credentials (assuming you followed the steps here, what permissions did you give it?

A 404 basically on auth basically means “Your ClientId doesn’t exist, or your ClientSecret doesn’t match, or you don’t have permission to the Audience you requested” They are intentionally vague to prevent someone getting their hands on your ClientID and brute-forcing your ClientSecret.

1 Like

Hi GotnOGuts,

Thanks for your grateful help. I missed this piece of puzzle. I only config the API credential, without configure the client credential on organization side.

it’s working great~

Thanks & Regards,
Coffee

Excellent!
Remember to mark your post as the solution so that everyone else that comes looking can find the answer :smiley:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.