Skip to content

Commit 0840d45

Browse files
authored
chore(docs): Clarify identity linking for SSO (supabase#46273)
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? - SSO accounts are not legible for any identity linking - Remove bit about choosing correct account when accepting invite as inviter specifies if invite is linked to SSO or not supabase#43615 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Clarified that accounts created via SAML SSO are ineligible for identity linking to existing user accounts (manual or automatic) * Updated organizational account and identity management guidance for SSO-enabled environments * Enhanced documentation on properly handling non-SSO account memberships in SSO-required organizations and preventing duplicate account creation <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46273?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 2c651dd commit 0840d45

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

apps/docs/content/guides/auth/auth-identity-linking.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@ Currently, Supabase Auth supports 2 strategies to link an identity to a user:
1212
1. [Automatic Linking](#automatic-linking)
1313
2. [Manual Linking](#manual-linking-beta)
1414

15+
<Admonition type="note" title="No identity linking for SSO accounts">
16+
17+
Users that signed up with [SAML SSO](/docs/guides/auth/sso/auth-sso-saml) will not be considered as targets for identity linking (automatic or manual) for security reasons.
18+
19+
</Admonition>
20+
1521
### Automatic linking
1622

1723
Supabase Auth automatically links identities with the same email address to a single user. This helps to improve the user experience when multiple OAuth login options are presented since the user does not need to remember which OAuth account they used to sign up with. When a new user signs in with OAuth, Supabase Auth will attempt to look for an existing user that uses the same email address. If a match is found, the new identity is linked to the user.
1824

1925
In order for automatic linking to correctly identify the user for linking, Supabase Auth needs to ensure that all user emails are unique. It would also be an insecure practice to automatically link an identity to a user with an unverified email address since that could lead to pre-account takeover attacks. To prevent this from happening, when a new identity can be linked to an existing user, Supabase Auth will remove any other unconfirmed identities linked to an existing user.
2026

21-
Users that signed up with [SAML SSO](/docs/guides/auth/sso/auth-sso-saml) will not be considered as targets for automatic linking.
22-
2327
### Manual linking (beta)
2428

2529
<Tabs

apps/docs/content/guides/auth/enterprise-sso/auth-sso-saml.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ Alternatively, you can use the `supabase sso info --project-ref <your-project>`
7878

7979
User accounts and identities created via SSO differ from regular (email, phone, password, social login...) accounts in these ways:
8080

81-
- **No automatic linking.**
82-
Each user account verified using a SSO identity provider will not be automatically linked to existing user accounts in the system. That is, if a user `valid.email@supabase.io` had signed up with a password, and then uses their company SSO login with your project, there will be two `valid.email@supabase.io` user accounts in the system.
81+
- **No identity linking.**
82+
Each user account verified using an SSO identity provider are not legible for [identity linking](/docs/guides/auth/auth-identity-linking) to existing user accounts for security reasons. That is, if a user `valid.email@supabase.io` had signed up with a password, and then uses their company SSO login with your project, there will be two `valid.email@supabase.io` user accounts in the system.
8383
- **Emails are not necessarily unique.**
84-
Given the behavior with no automatic linking, email addresses are no longer a unique identifier for a user account. Always use the user's UUID to correctly reference user accounts.
84+
Given the behavior with no identity linking, email addresses are no longer a unique identifier for a user account. Always use the user's UUID to correctly reference user accounts.
8585
- **Sessions may have a maximum duration.**
8686
Depending on the configuration of the identity provider, a login session established with SSO may forcibly log out a user after a certain period of time.
8787

apps/docs/content/guides/platform/sso.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ When SSO is enabled for an organization:
100100
6. Thoroughly test using our [SSO Testing and Best Practices](/docs/guides/platform/sso/testing-best-practices) guide
101101
7. Invite users to the organization or let them auto-join on login
102102

103-
<Admonition type="note" title="Account linking">
103+
<Admonition type="note" title="Non-SSO Accounts">
104104

105105
If a user is already a member of the organization under a non-SSO account, they will need to be removed and invited again with an SSO-required invitation to join under their SSO account. SSO and non-SSO accounts with the same email are treated as separate accounts.
106106

107107
</Admonition>
108108

109-
<Admonition type="note" title="No automatic linking">
109+
<Admonition type="note" title="No identity linking">
110110

111-
Each user account verified using a SSO identity provider will not be automatically linked to existing user accounts in the system. That is, if a user `valid.email@supabase.io` had signed up with a password, and then uses their company SSO login with your project, there will be two `valid.email@supabase.io` user accounts in the system.
111+
Each user account verified using an SSO identity provider will not be legible for [identity linking](/docs/guides/auth/auth-identity-linking) to existing user accounts in the system. That is, if a user `valid.email@supabase.io` had signed up with a password, and then uses their company SSO login with your project, there will be two `valid.email@supabase.io` user accounts in the system.
112112

113-
Users will need to ensure they are logged in with the correct account when accepting invites or accessing organizations/projects.
113+
Users will need to ensure they are logged in with the correct account when accessing organizations/projects.
114114

115115
</Admonition>
116116

0 commit comments

Comments
 (0)