How to implement social login using Azure AD B2C in Node.js with Axios

Sridhar Renganathan 0 Reputation points

I am trying to implement social login (Google, Facebook) using Azure AD B2C in Node.js and Angular. I have already configured the client ID and client secret in Azure and created a user flow. However, I'm having trouble finding documentation on how to integrate this in Node.js and Angular to store user information in a database and call the Azure social login API for registration and login. Can someone provide me with a sample using Axios in Node.js?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,110 questions
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,458 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
17,536 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 22,651 Reputation points Microsoft Employee

    Hi @Sridhar Renganathan ,

    Thanks for reaching out.

    To configure any social idP in your Azure AD B2C application, require you to create userflow or custom policy that you want to use for social login.

    You can create user flow/custom policy to setup Google IdP as mentioned here

    Facebook Idp -

    Then you can configure authentication in Node.js by passing user flow/custom policy in the configration file in node sample which automatically allow social idp on signup/sign in page.


    Reference sample -

    Hope this will help.



    Please remember to "Accept Answer" if answer helped you.

    0 comments No comments