microsoft / fluentui-blazor

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications
https://www.fluentui-blazor.net
MIT License
3.91k stars 377 forks source link

Blazor-server app uses a fallback authorization strategy, In the Login.razor file, I used the @Attribute [AllowAnonymous] attribute, but I still can't interact with it. I can't enter my email or password, and the login button doesn't respond.Is there something wrong with it? #2827

Closed zuijiaoghb closed 1 month ago

zuijiaoghb commented 1 month ago

jtpjsapp.zip

🐛 Bug Report

Using the revoke authorization strategy, the Login.razor file is not rendering properly.

💻 Repro or Code Sample

Program.cs Image

Login.razor Image

🤔 Expected Behavior

Image

🌍 Your Environment

centos8 , PC

vnbaaij commented 1 month ago

Using the revoke authorization strategy, the Login.razor file is not rendering properly.

You really need to be more prescriptive on what the issue is. Just that one sentence does not make it clear to us what the problem is. You did not change anything from your other issue report other than putting in a zip file of the reproduction code (without ANY explanation). Also, we still don't understand the language in the screenshot. This does not tell us what the expected behavior is.

Do you expect us to just figure out by ourselves what the issue is and hand you a solution ? Sorry, but open source does not work that way. You need to help us to help you.

I will not look at this until the details,, problem, etc are properly described. If not provided, this one will be closed as well.

zuijiaoghb commented 1 month ago

Blazor-server app using Microsoft.AspNetCore.Identity;using Microsoft.AspNetCore.Authorization; uses a fallback authorization strategy, In the Login.razor file, I used the @Attribute [AllowAnonymous] attribute, but I still can't interact with it. I can't enter my email or password, and the login button doesn't respond.Is there something wrong with it?

vnbaaij commented 1 month ago

The authorization pages need to be in SSR mode. Have you checked that?

zuijiaoghb commented 1 month ago

Image

The blazor server app is in SSR mode, and interactive server-side rendering (interactive SSR) is enabled by the "server" option. Is that the configuration?

zuijiaoghb commented 1 month ago

Image

The Login.razor page is also configured with @rendermode InteractiveServer。

vnbaaij commented 1 month ago

Look at how the pages are configured when creating a site with authentication through the template. The authentication pages need to be SSR (which in Blazor means NOT having @rendermode! )

Moving this to the discussion area as it is not a problem with the library but with your code/configuration. I think you need to study up a bit more on the .NET 8 rendermodes