Package org.matrix.android.sdk.api.auth

Types

Link copied to clipboard
interface AuthenticationService

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

Link copied to clipboard
interface HomeServerHistoryService

A simple service to remember homeservers you already connected to.

Link copied to clipboard
enum LoginType : Enum<LoginType>
Link copied to clipboard
enum SSOAction : Enum<SSOAction>

See https://github.com/matrix-org/matrix-spec-proposals/pull/3824

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class TokenBasedAuth(    @Json(name = "session") val session: String? = null,     @Json(name = "token") val token: String? = null,     @Json(name = "txn_id") val transactionId: String? = null,     @Json(name = "type") val type: String? = LoginFlowTypes.TOKEN) : UIABaseAuth

This class provides the authentication data by using user and password.

Link copied to clipboard
interface UIABaseAuth
Link copied to clipboard
data class UrlAndName(val url: String, val name: String)
Link copied to clipboard
interface UserInteractiveAuthInterceptor

Some API endpoints require authentication that interacts with the user. The homeserver may provide many different ways of authenticating, such as user/password auth, login via a social network (OAuth2), login by confirming a token sent to their email address, etc.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class UserPasswordAuth(    @Json(name = "session") val session: String? = null,     @Json(name = "type") val type: String? = LoginFlowTypes.PASSWORD,     @Json(name = "user") val user: String? = null,     @Json(name = "password") val password: String? = null) : UIABaseAuth

This class provides the authentication data by using user and password.

Functions

Link copied to clipboard
fun TermPolicies.toLocalizedLoginTerms(userLanguage: String, defaultLanguage: String = "en"): List<LocalizedFlowDataLoginTerms>

This method extract the policies from the login terms parameter, regarding the user language. For each policy, if user language is not found, the default language is used and if not found, the first url and name are used (not predictable)