Strategy

@Serializable(with = StrategySerializer::class)
sealed class Strategy

A typed authentication or verification strategy, such as email_code or oauth_google.

The Clerk API exchanges strategies as plain strings, and the SDK's models keep exposing those raw strings (for example com.clerk.api.network.model.factor.Factor.strategy). Use the typed accessors next to them (for example com.clerk.api.network.model.factor.Factor.strategyType) to compare strategies without string literals:

when (val strategy = factor.strategyType) {
Strategy.EmailCode -> showEmailCodeInput()
Strategy.Password -> showPasswordInput()
is Strategy.OAuth -> showSocialButton(strategy.provider)
else -> showGenericFactor()
}

Strategies the SDK does not know about decode to Unknown and keep their raw wire value, so a new server-side strategy never breaks decoding and round-trips unchanged. Two strategies are equal when their values are equal. Use Strategy.from to convert a raw string.

Inheritors

Types

Link copied to clipboard

A single-use backup code.

Link copied to clipboard
object Companion
Link copied to clipboard

A one-time code sent by email.

Link copied to clipboard

A magic link sent by email.

Link copied to clipboard

Enterprise SSO (SAML or OIDC) through an enterprise connection.

Link copied to clipboard

A Google One Tap / Credential Manager ID token.

Link copied to clipboard
class OAuth : Strategy

A redirect-based OAuth strategy, oauth_<provider> (for example oauth_google or oauth_custom_acme).

Link copied to clipboard

A native OAuth token exchange strategy, oauth_token_<provider>.

Link copied to clipboard
object Passkey : Strategy

A WebAuthn passkey.

Link copied to clipboard

The user's password.

Link copied to clipboard

A one-time code sent by SMS.

Link copied to clipboard

A password-reset code sent by email.

Link copied to clipboard

A password-reset code sent by SMS.

Link copied to clipboard
object Saml : Strategy

Legacy SAML SSO.

Link copied to clipboard
object Ticket : Strategy

A sign-in or sign-up ticket, such as an invitation or sign-in token.

Link copied to clipboard
object Totp : Strategy

A time-based one-time password from an authenticator app.

Link copied to clipboard

A transfer between a sign-in and a sign-up attempt.

Link copied to clipboard

A biometric credential stored on this device.

Link copied to clipboard

A strategy this version of the SDK does not recognize.

Properties

Link copied to clipboard

The raw strategy string sent to and received from the Clerk API.

Functions

Link copied to clipboard
operator override fun equals(other: Any?): Boolean
Link copied to clipboard
override fun hashCode(): Int
Link copied to clipboard
override fun toString(): String

Returns the raw wire value, so a Strategy can be interpolated into requests and logs.