How to authorize user’s role in client side of blazor wasm?

Environments Asp.Net Core 5.0 Blazor WebAssembly App (Asp.Net Core Hosting) Asp.Net Core Identity (with Identity Server 4) Problem I want to use Role-based authorization between Server side and Client side. I can login correctly and UserManager.IsInRoleAsync(user, “admin”) returns True in the Server side. But neither @attribute [Authorize(Roles = “admin”)] nor <AuthorizeView Roles=”admin”> doesn’t work in … Read more

Blazor WASM Authorization not working with AAD Roles

I am trying to set up AAD Authorization based on user defined roles following this doc https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/azure-active-directory-groups-and-roles?view=aspnetcore-3.1#user-defined-roles I am able to set it up in the app manifest and get the API authorization working. However when I try to do it on the UI side I cannot get the claim to appear. I did the json interpreting classes (DirectoryObjects, CustomUserAccount and Value(used by directory object)). I also added the CustomUserFactory removing the group stuff since I only care about roles: