Skip to content

Latest commit

 

History

History
 
 

auto-account-linking

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Azure AD B2C Auto Account Link

This policy sample demonstrates how to link an account when a user arrives with the same email as an existing account. When the email is detected as being the same, the user is prompted to sign in with one of the methods already registered on the existing account. Once complete, the account is linked.

Prerequisites

User Experience

Scenario 1

  • User has a Local Account (bob@contoso.com)
  • User logs in with Facebook, and Facebook returns the email claim - bob@contoso.com
  • User is presented with a screen to login with their Local Account
  • User logs in with the Local Account
  • Facebook account is merged with Local Account

Scenario 2

  • User has signed up with Facebook (bob@contoso.com)
  • User logs in with Google, and Google returns the email claim - bob@contoso.com
  • User is presented with a screen to login with their Facebook Account
  • User logs in with the Facebook Account (check is performed to make sure email returned matches)
  • Facebook account is merged with Google Account

Scenario 3

  • User has signed up with Facebook (bob@contoso.com), and linked their account with Google
  • User logs in with Twitter, and Twitter returns the email claim - bob@contoso.com
  • User is presented with a screen to login with their Facebook Account or Google Account
  • User logs in with the Facebook/Google (check is performed to make sure email returned matches)
  • Twitter account is merged with the Account

Scenario 4

  • User has signed up with Facebook (bob@contoso.com)
  • User tries to sign up for a Local Account with bob@contoso.com
  • User is presented with error, stating the account exists
  • User must perform forgot password flow
  • Local account is already merged with Facebook Account - All social sign ups result in Local Account with random password. This is due to not being able to add a Local Account to a Federated-only account.

How it works

TBC

Notes

This sample policy is based on SocialAndLocalAccountsWithMFA starter pack.