AuthenticationService

This interface defines methods to authenticate or to create an account to a matrix server.

Functions

Link copied to clipboard
abstract suspend fun cancelPendingLoginOrRegistration()

Cancel pending login or pending registration.

Link copied to clipboard
abstract suspend fun createSessionFromSso(homeServerConnectionConfig: HomeServerConnectionConfig, credentials: Credentials): Session

Create a session after a SSO successful login.

Link copied to clipboard
abstract suspend fun directAuthentication(homeServerConnectionConfig: HomeServerConnectionConfig, matrixId: String, password: String, initialDeviceName: String, deviceId: String? = null): Session

Authenticate with a matrixId and a password. Usually call this after a successful call to getWellKnownData().

Link copied to clipboard
abstract fun getFallbackUrl(forSignIn: Boolean, deviceId: String?): String?

Get the sign in or sign up fallback URL.

Link copied to clipboard

Get the last authenticated Session, if there is an active session.

Link copied to clipboard
abstract suspend fun getLoginFlow(homeServerConnectionConfig: HomeServerConnectionConfig): LoginFlowResult

Request the supported login flows for this homeserver. This is the first method to call to be able to get a wizard to login or to create an account.

Link copied to clipboard
abstract suspend fun getLoginFlowOfSession(sessionId: String): LoginFlowResult

Request the supported login flows for the corresponding sessionId.

Link copied to clipboard
abstract fun getLoginWizard(): LoginWizard

Return a LoginWizard, to login to the homeserver. The login flow has to be retrieved first.

Link copied to clipboard

Return a RegistrationWizard, to create an matrix account on the homeserver. The login flow has to be retrieved first.

Link copied to clipboard
abstract fun getSsoUrl(redirectUrl: String, deviceId: String?, providerId: String?, action: SSOAction): String?

Get a SSO url.

Link copied to clipboard
abstract suspend fun getWellKnownData(matrixId: String, homeServerConnectionConfig: HomeServerConnectionConfig?): WellknownResult

Perform a wellknown request, using the domain from the matrixId.

Link copied to clipboard

Check if there is an authenticated Session.

Link copied to clipboard

True when login and password has been sent with success to the homeserver.

Link copied to clipboard
abstract suspend fun loginUsingQrLoginToken(homeServerConnectionConfig: HomeServerConnectionConfig, loginToken: String, initialDeviceName: String? = null, deviceId: String? = null): Session

Authenticate using m.login.token method during sign in with QR code.

Link copied to clipboard
abstract suspend fun reset()

Reset all pending settings, including current HomeServerConnectionConfig.