-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect curl command to request bearer token #4092
Comments
I've assigned myself. In #4078 (currently in-progress), I'm re-writing auth guides across all APIs, and unifying them all to use the same curl requests for requesting a token. While doing that, I am ensuring that all token requests work. (You can see an example rewritten guide at that PR's preview site: https://preview.docs.camunda.cloud/pr-4078/docs/next/apis-tools/web-modeler-api/authentication/) |
@hamza-m-masood I am not experiencing this error when requesting a token against SaaS (see below). The content-type is specified as Were you running into this issue against a self-managed instance? I don't have one running right now and haven't verified if it is capable of accepting JSON input instead of form data, but I suspect that might be the case? Regardless -- can you confirm that the auth curl request on this page works, as it is the version I am planning to use for all auth guides in #4078? My successful token request from the originally linked instructions (with secrets stripped): ❯ curl -X POST --header 'content-type: application/json' --data '{"client_id": "...", "client_secret":"....","audience":"zeebe.camunda.io","grant_type":"client_credentials"}' https://login.cloud.camunda.io/oauth/token
{"access_token":"...","expires_in":81536,"token_type":"Bearer"}% |
@pepopowitz I tested on self-managed only. If you want a quick self-managed deployment, then you have two options:
The above curl request you mentioned did not work for me in my self-managed instance. I still get the same error. |
@hamza-m-masood and I talked in DMs, and I'm sharing the outcomes here:
These changes will be handled as part of #4078, and I'll update there to make sure I don't miss it. I will leave this issue open, until #4078 is complete. |
For what it's worth, rewriting the curl command to use form variables instead of JSON, especially with line-breaks, makes it much nicer to read, too. It's much easier to find the places to drop in your id/secret: After: Before: So this is an all-around win, thanks for raising it @hamza-m-masood. |
The curl command to request a bearer token in this section seems incorrect: https://docs.camunda.io/docs/apis-tools/zeebe-api-rest/zeebe-api-rest-authentication/
Why I try to run this command I get the following error:
This is probably because, the command is passing json into the body but instead, it is expecting a form.
Here is the correct command that worked for me:
Tagging relevant people:
@conceptualshark
@christinaausley
@pepopowitz
The text was updated successfully, but these errors were encountered: