I’m setting up OAuth 2.0 3LO auth as described in your docs here:
https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/
and I’ve reached the “2. Exchange authorization code for access token” section, but when I attempt to exchange the Authorization Code that Jira has provided me for an Access Token I get the following response:
{
"error": "invalid_grant",
"error_description": "Invalid authorization code"
}
I have even tried doing a request outside of my code using Insomnia and CURL and the results are the same. Below is an example of the CURL request:
curl --request POST \
--url https://auth.atlassian.com/oauth/token \
--header 'Content-Type: application/json' \
--data '{
"grant_type": "authorization_code",
"client_id": "gm6mvItwMtf4ihNh3cUpQODc29xI08w3",
"client_secret": "some-secret",
"code": "ihgcFCpM0gnA7XLf",
"redirect_uri": "mysite.fake/webhooks/36c3a858c298438523423a3223981/v1"
}'
(Please note that the “redirect_uri” above actually has https before the URL, but Atlassian’s helpful policy won’t allow me to include more than 1 link in my question so I had to pull it out…)
Which generates the same error:
{"error":"invalid_grant","error_description":"Invalid authorization code"}
Any suggestions as to how I might fix or debug this? Thanks for any help