Refresh token gives "Cannot read property 'scope' of undefined"

I am trying to make the following request:

const options3 = {
      url: 'https://{url}.us.auth0.com/oauth/token',
      method: 'POST',
      headers: {'content-type': 'application/x-www-form-urlencoded'},
      params: {
    
      },
      body: {
        'refresh_token': results['refresh_token'],
        'grant_type': 'refresh_token',
        'client_id': process.env.CLIENT_ID,
        'client_secret': process.env.CLIENT_SECRET,
      }
    }

I am sure that I am passing correct access token etc but I am somehow getting the following response:

status: 500
json: {
    "error": "access_denied",
    "error_description": "Cannot read property 'scope' of undefined"
}

Can anybody help with why this issue is happening?

Also, I tried same request with postman, but then the API returns

status: 401,
json: {
    "error": "access_denied",
    "error_description": "Unauthorized"
}

Though in postman, if I have content-type as application/json, I start getting 500 as above.

Note: I am making my actual request from Zapier (to authenticate my users over there).

Any help would be very kind. Thank you in advance :slight_smile:

1 Like

The first error seems like there is something wrong with the request, and the second error looks like the application is not authorized for some reason. Have you looked at your Auth0 logs to see if there is more info? Can you DM me your tenant name so I can also take a look?

I am going to mark this resolved after >14 days of idle time.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.