Crztean
Crztean

Reputation: 169

Blazor WebAssembly with IdentityServer 4 Customize Identity

I created a Blazor WebAssembly Hosted App with Identity Server4 and ASP.Net Core Identity using this Template:

dotnet new blazorwasm -au Individual -ho -o {APP NAME}

I followed and read this documentation: https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-identity-server?view=aspnetcore-5.0&tabs=visual-studio-code

Can somebody explain how to customize Identity Login and Register Pages and Logic? In MVC you scaffold the Identity Pages you want and they replace those from the dll. If I try to add some Pages on the Server project, how do I have to serve them? Do I need to create a Pages/Shared/_Layout like in a normal Razor Pages App or can I serve them with BlazorServer SignalR ? The Layout from the Client App should be the same for Identity. Or is this something you have to configure with IdentityServer4 ? Maybe somebody can explain how exactly IdentityServer4 and ASP.NET Core Identity are coupled in this template scenario. I also read some blogs about using only Core Identity for securing BlazorWasm Hosted, can you tell me the difference?

Upvotes: 1

Views: 839

Answers (1)

Cristovao Morgado
Cristovao Morgado

Reputation: 311

In this model when you scaffold the Identity pages you'll get the vanilla design. The thing is that as you noticed you're going from the blazor to a "razor" site .

What I've done is adapt the design to those pages.

The other way is to have an Identity server independent and implement a fully SPA for login and user management.

Upvotes: 1

Related Questions