Azure B2C social login: how to render a custom html asking for email and then if its valid- redirect to google authentication?

Anonymous
2023-07-05T09:40:17.0133333+00:00

Hi,

I'm using Azure B2C for my sass application.

My need is to provide an entry point to my application which renders an input asking the user to type their email.

After submitting the form, a serverless function should validate that email and if valid the user will be redirected to the identity provider authentication - which in my case is google.

I couldn't find any resource or documents explaining how to achieve that.

Currently, I'm using the sign up and sign in user flow and render custom html of my own, but I got the email and password of local account - which I don't want at all. If I uncheck the localAccount option in the user flow, the html won't render at all and the user is redirected to the google authentication immediately.

Already got the serverless function running and working with my current flow (validating the email from google).

Thanks!

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

2 answers

Sort by: Most helpful
  1. Ben Gimblett 4,560 Reputation points Microsoft Employee
    2023-07-05T14:58:32.83+00:00

    B2C does allow significant customization and there's possibility of downstream API integration.
    That's B2C custom policies.

    Right here I'm going to add a disclaimer; I'm not an expert on custom policies and they are a lot more complex than just setting up a regular out-of-the-box flow. So please keep that in mind.

    That all said; the extended B2C team manage samples for customers to get going (here) and in that repo there's a sample that should be at least fairly close to what you're asking, see here


  2. Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,526 Reputation points Moderator
    2023-08-03T08:17:54.6+00:00

    Hello @Anonymous , redirecting an Azure AD B2C user to an IdP based on its email its known as Home Realm Discovery. Take a look to the Azure AD B2C: Home Realm Discovery page sample. Althought it does not rely on any API you can easily move the IdP selection logic to yours and connect it trough a REST Technical Profile, as Ben suggests.

    Let us know if you need additional assistance. If the answer was helpful, please accept it and rate it so that others facing a similar issue can easily find a solution.


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.