I was able to wire up Azure AD B2C for authentication.
What I wanted to do next was to take a look at the Claims that were available, I knew how to do this in ASP.NET MVC, but struggled with how to accomplish this with Blazor Web Assembly.
Finally stumbled across this article, ASP.NET Core Blazor authentication and authorization.
There are three ways to do it.
- AuthenticationStateProvider service
- Expose the authentication state as a cascading parameter
- AuthorizeView component
I created a
Profile.razor page that demonstrates the three was to achieve this, the code should be below.
I am sure there are other ways, and maybe better ways, so would appreciated any feedback!