Ditto Authentication Provider
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);Content copied to clipboard
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());Content copied to clipboard
Since
4.12.0