When authenticating a user, the app successfully reaches the callback URL API Endpoint but while generating token via:
const { data } = await axios.post( `https://auth.atlassian.com/oauth/token`, { grant_type: "authorization_code", client_id: process.env.INTEGRATIONS_JIRA_CLIENT_ID, client_secret: process.env.INTEGRATIONS_JIRA_CLIENT_SECRET, code, redirect_uri: "https://staging-api.mydomain.com/api/v1/integration/jira/callback", },);
It returns:
{"error": "access_denied","error_description": "Unauthorized"}
But this works successfully in the case of localhost redirect_uri:
http://localhost:2000/api/v1/integration/jira/callback
Hi,
What datatype is code? Shouldn't that be
{ ...code: code,...}
Since you're passing an object to the request.
Hi prince, code is of string type here. In JavaScript, if you have a variable having name same as an object key name, you can skip writing it again.So,
{...code: code,...}
is the same as:
const code = "<string-value>";{...code,...}
So, I am passing string only.
It looks like you're new here. Sign in or register to get started.