Skip to content

.NET 8 Upgrade Causes Post-Logout Loop in Blazor Server App with Azure AD B2C #52245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
moshali1 opened this issue Nov 21, 2023 · 5 comments
Closed
Labels
area-blazor Includes: Blazor, Razor Components Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. Needs: Repro Indicates that the team needs a repro project to continue the investigation on this issue

Comments

@moshali1
Copy link

moshali1 commented Nov 21, 2023

Issue Summary:
After upgrading a Blazor server application from .NET 7 to .NET 8, which utilizes Azure AD B2C for authentication, a post-logout loop issue is occurring. This looping behavior during logout did not occur with .NET 7. The application handles login and other operations correctly when logged in, but fails to complete the logout process, resulting in a loop. This issue is distinct from previously reported issues #50725 and #51005, which were related to login problems.

Current Blazor Setup:
The application is configured for global interactivity, with render modes placed in HeadOutlet and Routes.

Logout Process:
The issue arises when using the Sign Out link, which is directed to /MicrosoftIdentity/Account/SignOut.

Screenshot for Reference:
Screenshot 2023-11-21 042320

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Nov 21, 2023
@mkArtakMSFT mkArtakMSFT added the Needs: Repro Indicates that the team needs a repro project to continue the investigation on this issue label Nov 21, 2023
@ghost
Copy link

ghost commented Nov 21, 2023

Thank you for filing this issue. In order for us to investigate this issue, please provide a minimal repro project that illustrates the problem without unnecessary code. Please share with us in a public GitHub repo because we cannot open ZIP attachments, and don't include any confidential content.

@ghost ghost added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Nov 21, 2023
@moshali1
Copy link
Author

Here is the minimal repo project.

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Nov 21, 2023
@gabrewer
Copy link

I am having the same issue. I found that a solution created with the template referenced in this issue #51202 has the same problem.

https://www.nuget.org/packages/VladislavAntonyuk.DotNetTemplates/3.0.247-pre4

@VladislavAntonyuk
Copy link

VladislavAntonyuk commented Nov 23, 2023

Add builder.Services.AddRazorPages(); in Program.cs. Microsoft.Identity.Web.UI still uses razor pages

@moshali1 moshali1 reopened this Nov 23, 2023
@moshali1
Copy link
Author

@VladislavAntonyuk, thank you so much for your assistance. Your suggestion was exactly what I needed, and it has successfully resolved the issue. I appreciate your help!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. Needs: Repro Indicates that the team needs a repro project to continue the investigation on this issue
Projects
None yet
Development

No branches or pull requests

4 participants