custom login page with B2C and Azure AD authentication



i am creating azure website with React js as front end and .net core web api for business layer.

i have two sets of user , internal users which i want to authenticate against azure AD and external users which authenticated against B2C ad

i want to create my own login page, where user will put email-ID and password and on the basis of email-id i want to decide if I need to authenticate against Azure AD or Azure B2C
is this possible to create such custom login page?

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

1 answer

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,236 Reputation points

    Hi @azure architect with .net expereince • Thank you for reaching out.

    Yes, you can create a custom page for your application where you can provide a text box to collect the email address of the user and based on the domain suffix of the email address, you can redirect the user to either B2C or Azure AD tenant for authentication. This is done by passing the domain suffix as domain_hint in the authentication request to facilitate the Home Realm Discovery (HRD).

    Please refer to the below custom policy sample for this purpose:
    A B2C IEF Custom Policy - A Sign In policy with Home Realm Discovery and a Default Identity Provider


    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.