Auth0 Home Blog Docs

.NetCore Invalid Token while calling management Api

api

#1

My Technology stack is :
.netcore
.Auth0 NugetPackage: https://github.com/auth0/auth0.net

I ma using The management Api. I’m able to receive the token from the first call at https://radupop.eu.auth0.com/oauth/token then I am creating a ManagementApiClient wihtt he access_token and my domain name. like this:

        var client = new ManagementApiClient(JObject.Parse(response.Content)["access_token"].Value<string>(), "radupop.eu.auth0.com");

Then I’m trying to get a user with:
var user = await client.Users.GetAsync(userId)

I’m getting Invalid token from api. I am sure that there is a setting, in auth0 profile, that i’m missing but I can’t find it.


#2

I am getting the authorization but when I try to authenticate with the bearer i get unauthorized , invalid token. I can’t understand why


#4

:wave: @radu.pop1 how are you obtaining the token for the management API? Please let me know if you were able to solve your issue?