Audience without userinfo endpoint to use /api/v2/users/

Hi everyone,

Im trying to list all the users with the /api/v2/users/ users but my access token comes with this structure:

{
http://my-api.api/roles”: [
“admin”,
“user”
],
http://my-api.api/email”: “my-email”,
“iss”: “{auth-audience}”,
“sub”: “user-id”,
“aud”: [
https://my-api.api”,
“{auth-audience}/userinfo”
],
“iat”: 1625848706,
“exp”: 1625935106,
“azp”: “Vk0cNhddmDAulI7mRdyVMe8oZ2YsvxKp”,
“scope”: “openid profile email admin user”,
“permissions”: [
“read:messages”,
“read:user_idp_tokens”,
“read:users”
]
}

But to use the /api/v2/users I need the audience without the “/userinfo”. How I can take off the rute “/userinfo” from the audience string

Hi @jorge.vazquez,

Welcome to the Auth0 Community!

You need to send the Auth0 Management API identifier as the audience when you request the token.

Here is an example:

Thanks for ur help, with that information I could solved my problem!

1 Like

Let us know if you have any other questions!

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