Managing external identities to enable secure access for partners, customers, and other non-employees
External ID in an external tenant: How to add social login to an existing account
When using social login, if no associated user object exists, a new user object will be created. However, what I want is to allow users to bind to an existing account.
Microsoft Security | Microsoft Entra | Microsoft Entra External ID
-
Rukmini • 43,915 Reputation points • Microsoft External Staff • Moderator
2026-05-27T13:51:35.1166667+00:00 Hey TU2, by default the built-in customer user flows in Microsoft Entra External ID will create a new local user any time a social user signs in and we can’t find an exact match already in the directory. There isn’t an out-of-the-box “link to existing account” toggle in the built-in flows today, but you can get exactly the behavior you want by doing one of the following:
- Use a custom policy (or a user-flow with a custom authentication extension) to intercept the sign-in, lookup an existing account by email/phone/etc., and then either • Link the social identity to that existing user (so no new account is created) • Or if none is found, fall back to creating a new account as usual
- Or build a small “link an identity” experience in your app’s profile page, where a logged-in customer can click “Add Google login” (or “Add Facebook login”). Your backend then calls Microsoft Graph (IdentityProvider.ReadWrite) to add the external provider to that user object.
Here are the key docs you’ll want to review:
• Create & customize customer user flows
• Add your own business logic with a custom authentication extension
• Overview of Microsoft Entra External ID for customers
https://learn.microsoft.com/entra/external-id/customers/overview-customers-ciam
Hope that helps! If you want more tailored guidance, can you share:
- Are you using built-in user flows or a fully custom policy?
- Which social ID provider(s) are you integrating (Google, Facebook, custom OIDC, etc.)?
- By what attribute do you want to detect existing accounts (email, phone, custom)?
- Do you prefer the link-at-sign-in approach or a post-sign-in “link identity” UX?
Note: This content was drafted with the help of an AI system. Please verify the information before relying on it for decision-making.
-
TU2 • 15 Reputation points
2026-05-27T14:43:33.45+00:00 Hi @Rukmini
- Which extension event can intercept the sign-in? Can I get the third-party ID(token) in this extension?
- Microsoft Graph (IdentityProvider) is not for user's identities
Are you using built-in user flows or a fully custom policy? --built-in user flows Which social ID provider(s) are you integrating (Google, Facebook, custom OIDC, etc.)? --Google and Facebook By what attribute do you want to detect existing accounts (email, phone, custom)? --custom Do you prefer the link-at-sign-in approach or a post-sign-in “link identity” UX? --post-sign-in “link identity” -
Rukmini • 43,915 Reputation points • Microsoft External Staff • Moderator
2026-05-28T11:37:45.39+00:00 Hello @TU2
An extension event that can intercept social sign-in and prevent automated user creation for account-linking scenarios is presently not available in built-in user flows. Additionally, the raw Google/Facebook ID token for custom merge/link logic during sign-in is not exposed by custom authentication extensions. A post-sign-in account connection flow is the recommended method for your situation:
- The user logs in using their current account
- The user chooses "Link Google/Facebook."
- Social authentication is finished by your app.
- Backend uses Microsoft Graph to refresh the user's collection of identities.
Therefore, post-sign-in identity linking is the suggested option for built-in flows.
-
Rukmini • 43,915 Reputation points • Microsoft External Staff • Moderator
2026-05-28T13:42:49.3366667+00:00 Hi @TU2,
- Step #3 indicates that, after the user has signed in, your app immediately completes the Google/Facebook OAuth procedure. Your backend uses Microsoft Graph to add the identity to the current Entra user's identities collection after verifying the social token.
- No, combining two user objects is not supported by Microsoft Graph. The method that is supported is: If a duplicate social account was formed, remove it and assign the social identity to the current user.
-
Rukmini • 43,915 Reputation points • Microsoft External Staff • Moderator
2026-05-29T09:51:52.19+00:00 Hello @TU2
The provider's SDK/OIDC flow should be used to implement the Google/Facebook OAuth flow directly.
IPublicClientApplication.loginPopup()is limited to Microsoft Entra/MSAL sign-in and cannot retrieve Google/Facebook identities for connecting.Hence:
- The user uses their current Entra account to log in.
- The user chooses "Link Google/Facebook."
- The app uses Facebook and Google OAuth for login.
- Using Microsoft Graph, the backend verifies the social token and modifies the user's "identities."
Therefore, instead of using MSAL
loginPopup(), use the provider's native OAuth flow in this situation.
Sign in to comment