Why does my Azure AD B2C go into infinite loop on login (localhost)

Lou's World Inc 71 Reputation points
2024-05-09T21:14:43.57+00:00

Followed tutorial (below) to set up a .Net 8 MVC app with an Azure AD B2C signin page. Using a new tenant with user flows. When I test the user flow with reply url, jwt.ms, a token is created. However, when I attempt to test login locally (https://localhost:1234/) the browser gets stuck in an infinite loop. I've tried logging in in private window (incognito)

https://learn.microsoft.com/en-us/aspnet/core/security/authentication/azure-ad-b2c?view=aspnetcore-8.0

@alfredorevilla-msft

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Azure | Azure Startups
{count} votes

Accepted answer
  1. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2024-05-10T20:49:00.1666667+00:00

    Hi @Lou's World Inc , one possible reason is that the redirect URI is not configured correctly. Please make sure that the redirect URI in your application registration matches the redirect URI in your code.

    Another possible reason is that the user flow is not configured correctly. Please make sure that the user flow is configured to return the correct claims and that the claims are mapped correctly in your code.

    If the issue persists, you can try enabling logging in your application to get more information about what is happening during the login process.

    If nothing here works please let me know and we can open a support ticket.

    Please let me know if you have any questions and I can help you further.

    If this answer helps you please mark "Accept Answer" so other users can reference it.

    Thank you,

    James

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.