Link an identity to a user
Links an oauth identity to an existing user. This method supports the PKCE flow.
- The Enable Manual Linking option must be enabled from your project's authentication settings.
- The user needs to be signed in to call
linkIdentity()
. - If the candidate identity is already linked to the existing user or another user,
linkIdentity()
will fail.
Parameters
provider
REQUIRED
OAuthProviderThe provider to link the identity to.
redirectTo
Optional
StringThe URL to redirect the user to after they sign in with the third-party provider.
scopes
Optional
StringA list of scopes to request from the third-party provider.
authScreenLaunchMode
Optional
LaunchModeThe launch mode for the auth screen. Defaults to LaunchMode.platformDefault
.
queryParams
Optional
Map<String, String>Additional query parameters to be passed to the OAuth flow.
await supabase.auth.linkIdentity(OAuthProvider.google);