Azure AD B2C Always redirected to login

Michael Vanderpool 41 Reputation points

I have a new Blazor Server application in .Net 5.0. Using the setup wizard, I entered the necessary information to connect to a new Azure AD B2C , and created the project. I set up the Azure AD using the following document (as well as the additional steps in the nav bar):

For information that I followed during the setup of the Blazor project, I used these articles:

With no additional changes to the project or the AD, I ran the Blazor project. Upon running the project, I am redirected to the login screen for the AD instead of the index page with the ability to login. Once logging in, everything works as expected (unless you log off). I verified there are no Authorized tags on the Blazor pages or components. What am I doing wrong?


Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,767 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Washington 911 Reputation points MVP

    Make sure you do not have .RequireAuthorization(); in your Startup.cs file.

    In this Server-Side Blazor app: you do not have to log in (unless you want to).
    The code for the app is here:
    You can compare that code to your own.

    Also see: Blazor and Azure B2C: The Big Picture

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful