Dear my friends,Unauthorized returns by auth0 when I use the /userinfo API. I don’t know how to deal with the problem. Have you ever encountered a similar problem? Thanks.
First I get the access_token for the customer using the following API:
curl --request POST
–url ‘https://YOUR_DOMAIN/oauth/token’
–header ‘content-type: application/x-www-form-urlencoded’
–data ‘grant_type=password&username=USERNAME&password=PASSWORD&audience=API_IDENTIFIER&scope=SCOPE&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET’
Next I tried querying a customer’s profile with access_token, but auth0 returned Unauthorized.
curl --request GET
–url ‘https://YOUR_DOMAIN/userinfo’
–header ‘Authorization: Bearer {ACCESS_TOKEN}’
–header ‘Content-Type: application/json’