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.

Functions

Link copied to clipboard

Gets a token for the current session.

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

Handles OAuth/SSO deep link callbacks.

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

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

Link copied to clipboard

Signs in via account portal.

Link copied to clipboard

Signs in via account portal.

Link copied to clipboard

Signs in with Enterprise SSO.

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 an ID token from an identity provider.

Link copied to clipboard

Signs in with OAuth 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 OTP - automatically sends the verification code.

Link copied to clipboard

Signs in with passkey.

Link copied to clipboard

Signs in with passkey.

Link copied to clipboard

Signs in with password authentication.

Link copied to clipboard

Signs in with password authentication.

Link copied to clipboard

Signs in with a ticket.

Link copied to clipboard

Signs in with a ticket.

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

Signs out the current session or a specific session.

Link copied to clipboard

Creates a new sign-up with the provided details.

Link copied to clipboard

Creates a new sign-up with the provided details.

Link copied to clipboard

Signs up via account portal.

Link copied to clipboard

Signs up via account portal.

Link copied to clipboard

Signs up with Enterprise SSO.

Link copied to clipboard

Signs up with Enterprise SSO.

Link copied to clipboard

Signs up with an ID token from an identity provider.

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 OAuth provider.

Link copied to clipboard

Signs up with a ticket.

Link copied to clipboard

Signs up with a ticket.