AuthType

sealed interface AuthType

The configuration for authentication.

Inheritors

Types

Link copied to clipboard
data class ApiKey(val defaultTtl: Duration? = null, val keyPrefixLength: Int = 8) : AuthType

API key based authentication, intended for machine-to-machine access. Keys are issued per-user and sent via the ApiKeyAuth header. Managing keys (issuing/listing/revoking) is itself protected by this same auth type, so an existing key (or a future combined auth type, see below) is required to mint additional keys.

Link copied to clipboard
data object NoAuth : AuthType

Completely opens all auth-handled endpoints.

Link copied to clipboard
data class OAuth(val providers: Map<String, AuthType.OAuth.ProviderConfig>, val clientCallbackPath: String, val accessTokenTtl: Duration = 15.minutes, val refreshTokenTtl: Duration = 30.days, val maxFailedAttempts: Int = 5, val lockOutDuration: Duration = 15.minutes, val cookieDomain: String? = null, val useSecureCookies: Boolean = true) : AuthType

Delegated to OAuthProvider with standard OAuth interceptors. Supports multiple providers.

Link copied to clipboard
data class Password(val validation: Validation<UserRequestModel> = defaultPasswordValidation, val accessTokenTtl: Duration = 15.minutes, val refreshTokenTtl: Duration = 30.days, val maxFailedAttempts: Int = 5, val lockOutDuration: Duration = 15.minutes, val cookieDomain: String? = null, val useSecureCookies: Boolean = true) : AuthType

Managed by the framework, with automatic handling of token issuing, rotation, and cookies.

Properties

Link copied to clipboard
Link copied to clipboard
open val cookieDomain: String?
Link copied to clipboard
Link copied to clipboard