Managed Auth: explicit-only identity linking before commit across PKCE and ID-token flows #52241
|
Does managed Supabase Auth support disabling automatic email-based identity linking while retaining social sign-in and authenticated explicit linking? If so, what supported configuration or pre-link enforcement point applies before identity writes commit across PKCE callbacks and ID-token grants? Can it require fresh existing-account authentication and application-recorded consent? Please identify the exact supported managed configuration/API or hook, release and availability constraints, including Free-plan availability. Please clarify coverage for ordinary social sign-in, authenticated manual linking, both PKCE callback and exchange, and ID-token sign-in/explicit-link grants. In particular, does a rejection roll back both identity changes and new session grants, or can an identity association already have committed? Is there a supported way to enforce a fresh existing-account proof and one-use consent operation, bound to the exact target User, provider/issuer and immutable subject, against direct API calls? We require no internal Auth-table trigger or custom Auth binary. |
Replies: 2 comments
|
Honest answer first: on managed Supabase Auth there is currently no single setting that makes all identity linking explicit-only. Some flows link automatically by design, and it helps to separate them:
Given that, if explicit-only linking is a hard compliance requirement, the patterns that actually hold up:
So: achievable as an enforced app-level policy plus auditing on the managed service; not achievable as a pure configuration guarantee. For a compliance document I'd state it exactly that way rather than implying the platform enforces it. |
|
One correction and one concrete risk to add. Correction: signUp with an existing email returns Risk: automatic linking matches on email, not the provider's subject (https://supabase.com/docs/guides/auth/auth-identity-linking). #52451 shows the effect: after moving from For your invariant: as far as I can tell there's no managed setting or pre-commit hook for links onto an existing user; Before User Created only covers new users. On hosted you can keep your own linking explicit ( select created_at,
payload->>'actor_id' as user_id,
payload->'traits' as traits
from auth.audit_log_entries
where payload->>'action' = 'identity_linked'
order by created_at desc;Compare with your consent records and alert on anything unmatched. The link is already committed when you see it, so this is detection, not prevention. Prevention needs Auth you control (self-hosted) or your own IdP in front. |
Honest answer first: on managed Supabase Auth there is currently no single setting that makes all identity linking explicit-only. Some flows link automatically by design, and it helps to separate them:
linkIdentity): explicit by nature, but it requires the user to already be signed in, manual linking enabled in the Auth settings, and the identity not att…