# Blazor, API, and role based Authorization

**URL:** <https://community.auth0.com/t/blazor-api-and-role-based-authorization/99657>\
**Category:** Get Help\
**Tags:** management-api, roles\
**Created:** [February 3, 2023, 1:37pm UTC](https://community.auth0.com/t/blazor-api-and-role-based-authorization/99657 "2023-02-03T13:37:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [February 3, 2023, 1:54pm UTC](https://community.auth0.com/t/blazor-api-and-role-based-authorization/99657/2 "2023-02-03T13:54:00Z")

</div>

Hey there!

Unfortunately we won’t be able to help you with that article as it wasn’t developed by us so it’s hard to share advice on a product that you haven’t invented but we can of course try to help you. Can I redirect you to a better place and ask you to ask this question in on of those threads? Thank you!

> [@Securing Blazor WebAssembly Apps](https://community.auth0.com/t/securing-blazor-webassembly-apps/46661/165):
>
> Hi @Ditchford , I tried to figure out what is happening with your application but honestly I’m afraid I can’t do much. As far as I know, this message is shown when your application comes across a \<NotAuthorized\> element and in the Blazor WASM case, it should happen on the client side (i.e., the server is not involved). For example, in the sample project of my article, this message is shown only once, before the user authentication. This is correct because the current not authenticated user is…

> [@What is Blazor? A Tutorial on Building Web Apps with Authentication](https://community.auth0.com/t/what-is-blazor-a-tutorial-on-building-web-apps-with-authentication/33611/143):
>
> Hey @den783245, Welcome to the Auth0 Community! To enable role-based authorization in your Blazor application, follow the instructions in [this document](https://github.com/auth0/auth0-aspnetcore-authentication/blob/main/EXAMPLES.md#roles). I suggest using [Actions](https://auth0.com/blog/introducing-auth0-actions/) to add the roles to the token instead of rules. After this, you can use the authorization components as explained [here](https://learn.microsoft.com/en-us/aspnet/core/blazor/security#authorization). I hope this helps.

---

_[View the full topic](https://community.auth0.com/t/blazor-api-and-role-based-authorization/99657)._
