DittoAuthenticator

Provides access to authentication information and methods for logging onto Ditto Cloud or Server. Relevant when using a DittoConfigConnect.Server config, or a legacy identity such as an DittoIdentity.OnlineWithAuthentication or DittoIdentity.OnlinePlayground identity.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

A lambda-based handler for authentication expiration events.

Link copied to clipboard

Returns the current authentication status.

Functions

Link copied to clipboard
suspend fun login(token: String, provider: DittoAuthenticationProvider): String?
fun login(token: String, provider: String, completion: (String?, DittoError?) -> Unit)
fun login(token: String, provider: String, completionCallback: DittoLoginCallback)

Log in to Ditto with a third-party token.

Link copied to clipboard
fun loginWithCredentials(username: String, password: String, provider: String, completion: (DittoError?) -> Unit)
fun loginWithCredentials(username: String, password: String, provider: String, completionCallback: DittoLoginCompletionCallback)

Log in to Ditto with a username and password.

Link copied to clipboard
fun loginWithToken(token: String, provider: String, completion: (DittoError?) -> Unit)
fun loginWithToken(token: String, provider: String, completionCallback: DittoLoginCompletionCallback)

Log in to Ditto with a third-party token.

Link copied to clipboard
fun logout(cleanupFn: (DittoBase) -> Unit? = null)

Log out of Ditto.

Link copied to clipboard

Registers a callback that is called whenever the authentication status changes.

Registers an observer object that is called whenever the authentication status changes.