-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
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
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
Metadata
Metadata
Assignees
Labels
Type
Projects
Status