Azure AD B2C | Can I have a login flow where If a user tries to login who doesnt already exist in Azure, then Azure AD B2C creates the user ?

Abhay Chandramouli 1,056 Reputation points
2022-04-26T09:06:44.137+00:00

Hi
I want to have a sign in flow, where if a user enters a email and password, and if the user doesnt exist, Azure should not show the error, but call an api using api-connector if the api response "yes" add the user to azure ad and log the user in.

@AmanpreetSingh-MSFT if you can help with this

Thank You !

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

1 answer

Sort by: Most helpful
  1. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2022-04-29T19:38:46.577+00:00

    Hi anonymous user , I recommend in this case to redirect to a sign-up page instead of automatically registering the user. There are a few reasons for this. What if the user already exists, but the username is input wrong? Or they use the wrong email? It's best to tell the user why the login is failing, especially if they've already visited the site. This could lead to duplicate users or misspelled email addresses, etc.

    Please let me know if you have any questions.

    Best,
    James

    0 comments No comments

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.