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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.