# .NetCore Invalid Token while calling management Api

**URL:** <https://community.auth0.com/t/netcore-invalid-token-while-calling-management-api/11987>\
**Category:** Get Help\
**Tags:** api\
**Created:** [May 31, 2018, 7:16am UTC](https://community.auth0.com/t/netcore-invalid-token-while-calling-management-api/11987 "2018-05-31T07:16:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![radu.pop1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@radu.pop1](https://community.auth0.com/u/radu.pop1)\
**Post date:** [May 31, 2018, 7:16am UTC](https://community.auth0.com/t/netcore-invalid-token-while-calling-management-api/11987/1 "2018-05-31T07:16:59Z")

</div>

My Technology stack is :  
.netcore  
.Auth0 NugetPackage: [GitHub - auth0/auth0.net: .NET client for the Auth0 Authentication & Management APIs. · GitHub](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](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.

---

<div class="post-metadata">

**Author:** ![radu.pop1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@radu.pop1](https://community.auth0.com/u/radu.pop1)\
**Post date:** [May 31, 2018, 7:31am UTC](https://community.auth0.com/t/netcore-invalid-token-while-calling-management-api/11987/2 "2018-05-31T07:31:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kimcodes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kimcodes/32/81052_2.png) [@kimcodes](https://community.auth0.com/u/kimcodes)\
**Post date:** [September 6, 2018, 1:41pm UTC](https://community.auth0.com/t/netcore-invalid-token-while-calling-management-api/11987/4 "2018-09-06T13:41:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 26, 2019, 9:57am UTC](https://community.auth0.com/t/netcore-invalid-token-while-calling-management-api/11987/5 "2019-07-26T09:57:04Z")

</div>


