Improve auth state provider guidance for BWAs #31496
Labels
8.0
.NET 8
aspnet-core/svc
doc-enhancement
Pri1
security/subsvc
Source - Docs.ms
Docs Customer feedback via GitHub Issue
Description
Following the documentation I came across an issue configuring authentication and authorization for a Blazor Server app. The [Authorize] attribute kept redirecting to (I assume) my authentication scheme's fallback path instead of just displaying the fallback message "Not authorized. I used Cookie Authentication. Neither role-based, policy-based nor the default policy was recognized.
After some research I've found this workaround to fix this problem. https://github.com/dotnet/aspnetcore/issues/52317#issuecomment-1830673284
The workaround just inserts a middleware step and assumingly skips the redirections issue.
Please add this information into the documentation since it seems to be a recent problem since the introduction of .NET 8.
Thank you!
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-8.0#additional-resources
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/security/index.md
Document ID
1247ee64-fbc9-ce29-0710-f6e59380f5ee
Article author
@guardrex
The text was updated successfully, but these errors were encountered: