TokenBasedAuth

@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.

Constructors

Link copied to clipboard
fun TokenBasedAuth(    @Json(name = "session") session: String? = null,     @Json(name = "token") token: String? = null,     @Json(name = "txn_id") transactionId: String? = null,     @Json(name = "type") type: String? = LoginFlowTypes.TOKEN)

Functions

Link copied to clipboard
open override fun asMap(): Map<String, *>
Link copied to clipboard
open override fun copyWithSession(session: String): TokenBasedAuth
Link copied to clipboard
open override fun hasAuthInfo(): Boolean

Properties

Link copied to clipboard
open override val session: String? = null

This is a session identifier that the client must pass back to the homeserver, if one is provided, in subsequent attempts to authenticate in the same API call.

Link copied to clipboard
val token: String? = null

A client may receive a login token via some external service, such as email or SMS. Note that a login token is separate from an access token, the latter providing general authentication to various API endpoints.

Link copied to clipboard
val transactionId: String? = null

The txn_id should be a random string generated by the client for the request. The same txn_id should be used if retrying the request. The txn_id may be used by the server to disallow other devices from using the token, thus providing "single use" tokens while still allowing the device to retry the request. This would be done by tying the token to the txn_id server side, as well as potentially invalidating the token completely once the device has successfully logged in (e.g. when we receive a request from the newly provisioned access_token).

Link copied to clipboard
val type: String?