Can I use the new razor Identity UI from .NET8 in Blazor Server Side? #53893
Labels
area-blazor
Includes: Blazor, Razor Components
design-proposal
This issue represents a design proposal for a different issue, linked in the description
✔️ Resolution: Answered
Resolved because the question asked by the original author has been answered.
question
Status: Resolved
Summary
In this article What’s new with identity in .NET 8
it is stated that:
However here In SSR, supply HttpContext as cascading value #50253 it is stated that:
So these two statements conflict with each other, because in the new .NET8 Blazor template for example the Login.razor page needs the HttpContext:
Other pages also use the
RedirectManager.RedirectToCurrentPageWithStatus
method which needsHttpContext
as a parameter.I have created a new project using this template:


And selected the Interactive render mode "Server"
And now when I start this application, I can see during debugging that the HttpContext from Cascading Parameter is not actually null:
In this template, the Program.cs has these lines:
Am I correct to assume that means I am using what used to be Blazor Server Side nad now Interactive Server Side Rendering? And if yes, then why in such case the HttpContext is not null?
Motivation and goals
I would like to use the new Blazor Identity UI in the application which I updated from .NET7 to .NET8
In scope
Clarification as to how can I use Identity in Blazor SS.
Do I still need _Host.cshtml to extract authentication information from HttpContext during application load?
Can I use new Identity razor components in Blazor SS-only application?
Can I access HttpContext in a Blazor SS-only application?
Is Blazor Server Side now renamed "interactive SSR" in the documentation?
The text was updated successfully, but these errors were encountered: