Azure AD B2C integration with Azure AD

Sebastian Hew 1 Reputation point
2022-05-18T12:39:15.163+00:00

I'm trying to integrate Azure AD B2C with Azure AD as an identity provider. My ideal solution for this flow would be to

  1. User visits my application and is not logged in, my application sends the user to the login-flow which immediately redirects the user to the Azure AD login page
  2. If this is the first time the user logs in to my application, a user within Azure AD B2C is automatically created with firstname, lastname and email which are sent from Azure AD.

In short, I want everything to be as seamless as possible for the end user. I did everything in this guide https://learn.microsoft.com/en-us/azure/active-directory-b2c/identity-provider-azure-ad-single-tenant?pivots=b2c-user-flow to set this up, but when using a regular signin-flow I get an error that says the user does not exist. If I use the signin/signup-flow I am redirected to the B2C signup-page (with the data from Azure AD prefilled).

Is it possible to register users automatically instead of having the manually signup the first time they signin?

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,663 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. DisplayName-3010 131 Reputation points
    2022-05-19T04:23:03.863+00:00

    Hi @Sebastian Hew ,

    Yes it is possible with custom policies. If you do not need any additional information from the user. You can first try to read the user without error if the user does not exist and then write the user if no objectId was found.

    If you only have login with an Azure AD tenant, why are you using Azure AD B2C? You might want t directly attach the application to your Azure AD Tenant.