-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
In the latest template for Blazor Server Side with Microsoft Identity platform. program.cs has:
builder.Services.AddAuthorization(options =>
{
// By default, all incoming requests will be authorized according to the default policy
options.FallbackPolicy = options.DefaultPolicy;
});
So now all pages will direct to login. However, if I want to define a landing page that doesn't require login with
@Attribute [Microsoft.AspNetCore.Authorization.AllowAnonymous]
, it doesn't work. Page still gets redirected to login.
Maybe this is related to #37064 and #23157
cc: @guardrex per dotnet/AspNetCore.Docs#24473
Expected Behavior
Pages marked with Attribute AllowAnonymous should not be redirected to login if not logged in
Steps To Reproduce
-Start a project with Blazor Server Side with Microsoft Identity Platform.
-Fill in all the required AADB2C configs
-Launch the site to see if AADB2C is setup correctly. clean up (logout)
-go to index.razor or fetchData.razor and add @Attribute [Microsoft.AspNetCore.Authorization.AllowAnonymous]
-Launch site. It still requires AADB2C login on index,razor or fetchData.razor
Exceptions (if any)
No response
.NET Version
6.0.100
Anything else?
No response