auth0-authorization-extension icon indicating copy to clipboard operation
auth0-authorization-extension copied to clipboard

401 - {"statusCode":401,"error":"Unauthorized","message":"Invalid token","attributes":{"error":"Invalid token"}}

Open joeypedicini92 opened this issue 6 years ago • 3 comments

I'm trying to use the API for the first time, however every request seems to result in the above error.

Seems to be the same as this but can't find a resolution: https://community.auth0.com/t/invalid-token-when-accessing-authorization-extension-api/8339/3

I've verified the way I'm getting and setting the token multiple times

{
  method: 'POST',
  uri: `https://${TENANT}.auth0.com/oauth/token`,
  headers: { 'content-type': 'application/json' },
  body:
  {
    grant_type: 'client_credentials',
    client_id: CLIENT,
    client_secret: SECRET,
    audience: `urn:auth0-authz-api`
  },
  json: true
};
{
      method: 'GET',
      uri: encodeURI(`https://${TENANT}.us8.webtask.io/${EXT_ID}/api/groups`),
      headers: { 
        'content-type': 'application/json',
        Authorization: `Bearer ${accessToken}`
      },
      json: true
    }

And the Machine-Machine client has access to all the scopes for this api which I've enabled. Is this broken or am I still doing something wrong?

joeypedicini92 avatar Oct 28 '18 15:10 joeypedicini92

Just in case anyone comes across this error in the future. I fixed this problem by allowing the grant type "client_credentials" in my applications "advanced settings". May not be the solution to this exact error though.

Exilliar avatar Jan 25 '19 13:01 Exilliar

Could be related to #250 .

chillyistkult avatar Mar 25 '19 09:03 chillyistkult

Tengo este mismo error y no encuentro la solucion todavia

JoseFuentes-Dev avatar Dec 08 '22 21:12 JoseFuentes-Dev