Auth

class Auth

Main Auth class providing all authentication entry points.

Access via Clerk.auth.

This class provides a centralized, DSL-style API for all authentication operations including:

  • Sign in with various methods (password, OTP, OAuth, passkey, etc.)

  • Sign up with various methods

  • Session management (sign out, set active session, get tokens)

  • Deep link handling for OAuth/SSO callbacks

Example usage:

// Sign in with email (requires separate sendCode call)
val signIn = clerk.auth.signIn { email = "user@email.com" }

// Sign in with password
val signIn = clerk.auth.signInWithPassword {
identifier = "user@email.com"
password = "password"
}

// Sign in with OTP (automatically sends code)
val signIn = clerk.auth.signInWithOtp { email = "user@email.com" }

// Sign out
clerk.auth.signOut()

Properties

Link copied to clipboard

The current sign-in attempt, if one is in progress.

Link copied to clipboard

The current sign-up attempt, if one is in progress.

Link copied to clipboard
val events: Flow<AuthEvent>

Flow of authentication events.

Link copied to clipboard

Native magic-link manager for PKCE-bound email link flows.

Link copied to clipboard

The sessions currently known on this client.

Functions

Link copied to clipboard

Completes a pending native magic-link flow using callback values from the deep link.

Link copied to clipboard

Gets a token for the current session.

Link copied to clipboard
suspend fun handle(uri: Uri?): Boolean

Handles OAuth/SSO and native magic-link deep link callbacks.

Link copied to clipboard

Handles a native magic-link deep-link callback and completes the matching auth flow.

Link copied to clipboard

Revokes a session.

Link copied to clipboard
suspend fun setActive(sessionId: String, organizationId: String? = null): ClerkResult<Session, ClerkErrorResponse>

Sets the active session.

Link copied to clipboard

Starts sign-in with an identifier (email, phone, or username).

Link copied to clipboard

Signs in with Enterprise SSO.

Link copied to clipboard

Signs in with an ID token from an identity provider.

Link copied to clipboard

Signs in with OAuth provider.

Link copied to clipboard

Signs in with OTP - automatically sends the verification code.

Link copied to clipboard

Signs in with passkey.

Link copied to clipboard

Signs in with password authentication.

Link copied to clipboard

Signs in with a ticket.

Link copied to clipboard
suspend fun signOut(sessionId: String? = null): ClerkResult<Unit, ClerkErrorResponse>

Signs out all sessions or removes a specific session from the current client.

Link copied to clipboard

Creates a new sign-up with the provided details.

Link copied to clipboard

Signs up with Enterprise SSO.

Link copied to clipboard

Signs up with Google One Tap.

Link copied to clipboard

Signs up with an ID token from an identity provider.

Link copied to clipboard

Signs up with OAuth provider.

Link copied to clipboard

Signs up with a ticket.

Link copied to clipboard

Starts a native email-link sign-in flow secured by PKCE.