User account linking
Ory allows users to link their accounts to social sing-in providers after they sign up, as well as un-link social sign-in providers they previously added.
Users can link their accounts only to social providers you configured in your Ory project.
Users can use account linking and un-linking:
- to start signing in with a profile created in a social sign-in provider when they originally signed up with email and password
- to link another social sign-in provider to their profile so that they can sign in with their GitHub profile and their Facebook profile
- to remove a social sign-in provider link from the profile (possible only when multiple sign-in methods are available to prevent locking users out from accounts)
Linking accounts
Users link can link accounts manually through their account's settings page. To try out account linking, use the Ory Account Experience. Follow these steps:
- Configure at least two sign-up methods in your Ory project. One of these methods must be through a social sign-in provider.
- Go to your project's Ory Account Experience at
https://{project.slug}.projects.oryapis.com/ui
and sign up. - After you sign up, go to Account Settings and navigate to the Social Sign In section.
- Select one of the buttons to link an available social sign-in provider.
Un-linking account
Users with multiple sign-in methods can un-link social sign-in providers from their account through their account's settings page. To try out account un-linking, use the Ory Account Experience. Follow these steps:
- Go to your project's Ory Account Experience at
https://{project.slug}.projects.oryapis.com/ui
and sign in with a user account with multiple sign-in methods available. - Go to Account Settings and navigate to the Social Sign In section.
- Use the buttons to un-link a social sign-in provider.
Automatic account linking
While it is convenient for users, automatic account linking creates an attack vector that can allow malicious actors to steal user accounts.
Since it constitutes a security threat, automatic account linking is not available in Ory.
To better understand the danger, consider the following scenario:
- Your application allows users to create new accounts or sign in with ACME - a well-known social sign-in provider.
- John creates a new account in your application using his
john@doe.com
email. - Malicious actors know that John uses
john@doe.com
to sign in to his account in your app. - Malicious actors create an ACME account for
john@doe.com
. - Malicious actors sign up in your application using the ACME account created for the
john@doe.com
account. - Your system uses the default behavior and when it detects two accounts with the same identifier, malicious actors are asked to link the accounts.
- Malicious actors link the accounts.
- Malicious actors get access to the account that John created manually using his
john@doe.com
email.