link Identity
abstract suspend fun linkIdentity(provider: OAuthProvider, redirectUrl: String? = defaultRedirectUrl(), config: ExternalAuthConfigDefaults.() -> Unit = {}): String?(source)
Links an OAuth Identity to an existing user.
Example:
val url = supabase.auth.linkIdentity(Google)
// Open the url in the browser, but this will happen automatically if [ExternalAuthConfigDefaults.automaticallyOpenUrl] is true (which it is by default)Content copied to clipboard
This method works similar to signing in with OAuth providers. Refer to the documentation to learn how to handle OAuth and OTP links.
Return
The OAuth url to open in the browser if ExternalAuthConfigDefaults.automaticallyOpenUrl is false, otherwise null.
Parameters
provider
The OAuth provider
redirect Url
The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android.
config
Extra configuration
Throws
Rest Exception
or one of its subclasses if receiving an error response. If the error response contains a error code, an AuthRestException will be thrown which can be used to easier identify the problem.
Http Request Timeout Exception
if the request timed out
Http Request Exception
on network related issues