# After Auth0 login- 401 back

**URL:** <https://community.auth0.com/t/after-auth0-login-401-back/12975>\
**Category:** Get Help\
**Tags:** jwt, auth0\
**Created:** [July 10, 2018, 12:23pm UTC](https://community.auth0.com/t/after-auth0-login-401-back/12975 "2018-07-10T12:23:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexandra.damaschin](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alexandra.damaschin/32/8301_2.png) [@alexandra.damaschin](https://community.auth0.com/u/alexandra.damaschin)\
**Post date:** [July 10, 2018, 12:23pm UTC](https://community.auth0.com/t/after-auth0-login-401-back/12975/1 "2018-07-10T12:23:41Z")

</div>

I used the quickstart for .net core 2.0 client (api explorer) and web api in order to obtain a token which will give me access to use my authorized api.

I got working the login and to obtain an access\_token but when I use that access\_token I receive back a 401.  
Where can be the error? code or auth0?

[Here](https://github.com/AlexandraDamaschin/Auth0) is a link to my project

---

<div class="post-metadata">

**Author:** ![Carlos\_Mostek](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/carlos_mostek/32/8140_2.png) [@Carlos\_Mostek](https://community.auth0.com/u/Carlos_Mostek)\
**Post date:** [July 10, 2018, 8:11pm UTC](https://community.auth0.com/t/after-auth0-login-401-back/12975/2 "2018-07-10T20:11:24Z")

</div>

Take a look at your token validation in your WebAPI. You should be doing a validation on the access token. You need to make sure that is configured correctly. I would walk through it with a debugger. Make sure you are setting the audience and issuer correctly, and make sure you are using RS256 signature validation correctly.

---

<div class="post-metadata">

**Author:** ![alexandra.damaschin](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alexandra.damaschin/32/8301_2.png) [@alexandra.damaschin](https://community.auth0.com/u/alexandra.damaschin)\
**Post date:** [July 11, 2018, 8:18am UTC](https://community.auth0.com/t/after-auth0-login-401-back/12975/3 "2018-07-11T08:18:53Z")

</div>

I went with the debugger and I have back my token which contains the audience(my api) but when I call that api I get back a json which contains my token and information about. I don’t receive back information from my api.

---

<div class="post-metadata">

**Author:** ![Carlos\_Mostek](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/carlos_mostek/32/8140_2.png) [@Carlos\_Mostek](https://community.auth0.com/u/Carlos_Mostek)\
**Post date:** [July 11, 2018, 5:10pm UTC](https://community.auth0.com/t/after-auth0-login-401-back/12975/4 "2018-07-11T17:10:02Z")

</div>

It sounds like it might be something within your API.

You added an authorization policy with read:messages. Which endpoint are you calling? Do you have the read:messages scope in your token?

I’m curious what you mean by “I get back a json which contains my token and information about”

---

<div class="post-metadata">

**Author:** ![alexandra.damaschin](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alexandra.damaschin/32/8301_2.png) [@alexandra.damaschin](https://community.auth0.com/u/alexandra.damaschin)\
**Post date:** [July 16, 2018, 11:44am UTC](https://community.auth0.com/t/after-auth0-login-401-back/12975/5 "2018-07-16T11:44:12Z")

</div>

By “I get back a json which contains my token and information about” i mean that I was getting back a json with my token inside and my error number in this case 401.

My error was actually from my API. A letter spelled incorrect and a lot of bad things can happen.

Thanks for your help anyway.

---

<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:** [December 17, 2018, 10:43am UTC](https://community.auth0.com/t/after-auth0-login-401-back/12975/6 "2018-12-17T10:43:06Z")

</div>


