Adding roles
Blazor Server and Blazor WebAssembly handle roles a bit differently; it’s nothing major, but we need to do different implementations. In this chapter, we will take a look at implementing it for our current project (per component) and return to roles in Chapter 16, Going Deeper into WebAssembly.
Configuring Auth0 by adding roles
Let’s start by adding roles in Auth0:
- Log in to
Auth0
, navigate to User Management | Roles, and click Create Role. - Enter the name
Administrator
and the descriptionCan do anything
and press Create. - Go to the Users tab, click Add Users, search for your user, and then click Assign. You can also manage roles from the Users menu on the left.
- By default, roles won’t be sent to the client, so we need to enrich the data to include roles.
We do that by adding an action.
- Go to Actions, and then Flows.
Flows are a way to execute code in a particular flow.
We want Auth0...