DittoAuthenticationProvider

data class DittoAuthenticationProvider(val rawValue: String)

Represents a string-based authentication provider identifier used for login with Ditto.

Important: This API is in preview and provides a type-safe struct for specifying authentication providers, using the extensible-enum pattern. Supports both built-in and custom providers in a consistent and ergonomic way in v5.

This class defines built-in providers such as development, and also allows defining custom providers by passing an arbitrary string to custom or by using the constructor.

Custom providers can be defined as follows:

val provider = DittoAuthenticationProvider.custom("my-custom-provider")
ditto.auth.login(token, provider);

Providers can also be defined using a companion object function for convenience:

fun DittoAuthenticationProvider.Companion.myProvider(): DittoAuthenticationProvider =
custom("my-custom-provider")
ditto.auth.login(token, DittoAuthenticationProvider.myProvider());

Since

4.12.0

Constructors

Link copied to clipboard
constructor(rawValue: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard