# Auth0 .NET Core 3.1 JWT Authorization How

**URL:** <https://community.auth0.com/t/auth0-net-core-3-1-jwt-authorization-how/45616>\
**Category:** JWT.io\
**Created:** [July 1, 2020, 2:16pm UTC](https://community.auth0.com/t/auth0-net-core-3-1-jwt-authorization-how/45616 "2020-07-01T14:16:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![imjason](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/imjason/32/9799_2.png) [@imjason](https://community.auth0.com/u/imjason)\
**Post date:** [July 1, 2020, 2:16pm UTC](https://community.auth0.com/t/auth0-net-core-3-1-jwt-authorization-how/45616/1 "2020-07-01T14:16:36Z")

</div>

Trying to understand how I can take roles or permissions in my Auth0 tenant and have them added to a token (Test or otherwise) and use that data to fulfill Policy Requirements as indicated in my .NET Core 3.1 WebApi code.

Thanks

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 2, 2020, 10:25pm UTC](https://community.auth0.com/t/auth0-net-core-3-1-jwt-authorization-how/45616/3 "2020-07-02T22:25:10Z")

</div>

Hi @imjason,

Welcome to the Community!

I would recommend starting here:

> **[Configure Core Authorization Features for Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/configure-core-rbac)**
>
> Learn how to configure Auth0 Core Authorization features for role-based access control (RBAC) of your APIs.

> **[Sample Use Cases: Role-Based Access Control](https://auth0.com/docs/manage-users/access-control/sample-use-cases-role-based-access-control)**
>
> Learn how to implement roles-based authorization (RBAC) in different scenarios and explore how to use rules with RBAC.

And look at this rule for how to add roles to the token:

> **[Sample Use Cases: Rules with Authorization](https://auth0.com/docs/manage-users/access-control/sample-use-cases-rules-with-authorization)**
>
> Learn how to use rules with roles-based access control (RBAC). For use with our Authorization Core feature set.

let me know if you have further questions,  
Dan

---

<div class="post-metadata">

**Author:** ![imjason](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/imjason/32/9799_2.png) [@imjason](https://community.auth0.com/u/imjason)\
**Post date:** [July 3, 2020, 2:45am UTC](https://community.auth0.com/t/auth0-net-core-3-1-jwt-authorization-how/45616/4 "2020-07-03T02:45:07Z")

</div>

Dan,

Thanks for your response, it was good to review and double check that I had hit all of the points of interest. Currently, I have permissions defined for a registered API, I have a role defined that includes that permission and a user assigned to that role.

My issue is, when I visit the API in the portal and go to Test the token I get back (Bearer) does not contain permission information despite RBAC being enabled. I had thought I needed to add a rule but that seems to be true if I want the role to come down - which I do, eventually.

I am wondering if, maybe, I am seeing no permissions because I am getting my token from Test in the portal rather than logging in with an application.

Thoughts?

---

<div class="post-metadata">

**Author:** ![imjason](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/imjason/32/9799_2.png) [@imjason](https://community.auth0.com/u/imjason)\
**Post date:** [July 3, 2020, 3:01am UTC](https://community.auth0.com/t/auth0-net-core-3-1-jwt-authorization-how/45616/5 "2020-07-03T03:01:22Z")

</div>

Tried my login with the SPA sample. Something is wrong. I do not get any claim or permission information from anywhere in the token. I have RBAC enabled and have indicated I want permissions added to the token. Why are they not there?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 6, 2020, 3:40pm UTC](https://community.auth0.com/t/auth0-net-core-3-1-jwt-authorization-how/45616/6 "2020-07-06T15:40:20Z")

</div>

@imjason,

The test application will get you a machine to machine token. There wouldn’t be a user in that scenario that would have roles.

Can you **send me a DM** with a HAR of the auth transaction from your SPA. Make sure you are logging in as a user that has the roles assigned.

> **[Generate and Analyze HAR Files](https://auth0.com/docs/troubleshoot/troubleshooting-tools/generate-and-analyze-har-files)**
>
> Learn how to troubleshoot with HAR files and steps to generate a HAR file.

Thanks,  
Dan

---

<div class="post-metadata">

**Author:** ![imjason](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/imjason/32/9799_2.png) [@imjason](https://community.auth0.com/u/imjason)\
**Post date:** [July 6, 2020, 4:13pm UTC](https://community.auth0.com/t/auth0-net-core-3-1-jwt-authorization-how/45616/7 "2020-07-06T16:13:18Z")

</div>

I spoke with someone over Twitter and we did a screen share and they helped me through my misunderstanding

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 6, 2020, 4:25pm UTC](https://community.auth0.com/t/auth0-net-core-3-1-jwt-authorization-how/45616/8 "2020-07-06T16:25:42Z")

</div>

Glad it was resolved! Please post a solution if you have the time.

Thanks for letting us know,  
Dan

---

<div class="post-metadata">

**Author:** ![imjason](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/imjason/32/9799_2.png) [@imjason](https://community.auth0.com/u/imjason)\
**Post date:** [July 8, 2020, 2:13am UTC](https://community.auth0.com/t/auth0-net-core-3-1-jwt-authorization-how/45616/9 "2020-07-08T02:13:59Z")

</div>

> **[Authorization with Auth0 in .NET Core 3.1](https://jfarrell.net/2020/07/05/authorization-with-auth0-in-net-core-3-1/)**
>
> Auth0 ( remains one of the leaders in handling authentication and user management for sites. While it may seem odd to some to offload such a critical aspect of your application to a third party, th…

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 9, 2020, 8:38pm UTC](https://community.auth0.com/t/auth0-net-core-3-1-jwt-authorization-how/45616/10 "2020-07-09T20:38:27Z")

</div>

Thanks for following up!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 24, 2020, 8:46pm UTC](https://community.auth0.com/t/auth0-net-core-3-1-jwt-authorization-how/45616/11 "2020-07-24T20:46:47Z")

</div>

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