Calling https://rwehresmann.auth0.com/api/v2/tickets/email-verification
results in the following error:
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Bad audience: survivorbet.com https://rwehresmann.auth0.com/userinfo"
}
Any idea of what am I doing wrong?
Hey there @rwehresmann!
Are you sure you’re using the right tenant name in your call? It might be the main reason that affect your audience .
When it comes to the request
{
"client_id":"clientID",
"client_secret":"XXXX",
"grant_type":"client_credentials",
"audience":"https://[tenant].eu.auth0.com/api/v2/"
}
Let me know if that helps!
Hello @konrad.sopala, thanks for the reply!
You’re right, I changed but now I receive "Insufficient scope, expected any of: create:user_tickets"
. However, my Auth0 Management API have this scope defined. What should be my next step?
And I would like to ask: api/v2/tickets/email-verification
will always go for Auth0 Management API? The error I had before was happening because I tryied to use the audience of a custom API that I created in my Auth0 account.
Hey @rwehresmann!
Sorry for one thing my bad, didn’t check your tenant region. So instead of
"audience":"https://[tenant].eu.auth0.com/api/v2/"
you should go for:
“audience”:“https://[tenant].us.auth0.com/api/v2/”
in
{
"client_id":"clientID",
"client_secret":"XXXX",
"grant_type":"client_credentials",
"audience":"https://[tenant].eu.auth0.com/api/v2/"
}
What is more I think you’re using the wrong access token in the Management API. The survivorbet.com domain name is for sale. Inquire now. is not the Management API, it’s probably some other API you have defined right?
The core here is that you’re probably logging in, getting a regular access token and using it with the Management API.
Hope it helps!
Hey there @rwehresmann!
Have you been able to check out what I’ve provided up there in the meantime?
Let me know if you need further help!