signInWithOAuth

suspend fun signInWithOAuth(provider: OAuthProvider, transferable: Boolean = true, redirectUrl: String = RedirectConfiguration.DEFAULT_REDIRECT_URL): ClerkResult<OAuthResult, ClerkErrorResponse>

Signs in with OAuth provider.

Return

A ClerkResult containing the OAuthResult on success, or a ClerkErrorResponse on failure. The result holds a sign-up instead of a sign-in when the flow transferred.

Example usage:

val result = clerk.auth.signInWithOAuth(OAuthProvider.GOOGLE)

Parameters

provider

The OAuth provider to use for authentication.

transferable

Whether the flow may turn into a sign-up when the provider account has no Clerk user yet. When false, that case fails instead. Defaults to true.

redirectUrl

The native callback URL. Defaults to the callback registered by the SDK. A custom value needs an intent filter that routes it to com.clerk.api.sso.SSOReceiverActivity in the application manifest. handle only completes OAuth callbacks with a clerk scheme.