interface UserManager
Manages user authentication. Provides methods for login, logout, change password and the logged-in/out
sealed class Status
Base class for the possible statuses of the SmartWorkspaceSdk |
abstract fun changePassword(currentPassword: String, newPassword: String, newPasswordConfirmation: String): LiveData<SimpleResponse<Void>>
Changes the user password on the backend. This option is only valid if the application uses usernamePasswordLogin. |
|
abstract fun externalTokenLogin(authenticationToken: String): LiveData<SimpleResponse<Void>>
Login the user using server-to-server pre-shared authentication token. This is used when the host app backend registers a token for that user on the Smart Workspaces backend. |
|
abstract fun getStatus(): LiveData<Status>
Get observable status of the SDK. The Status is a Kotlin sealed class. That means they might contain extra parameters inside such as server messages, or error codes. |
|
abstract fun getUser(): LiveData<SimpleResponse<User>>
Get a LiveData of the logged-in user. This includes name, email, etc. |
|
abstract fun logout(): Unit
Logs out the user. The status will immediately change to Status.LoggingOut This process might take a couple of seconds to complete and then the status will change to Status.Initializing |
|
abstract fun oAuth2Login(redirectedUri: String): LiveData<SimpleResponse<Void>>
Login the user using OAuth2. This usually happens after a Chrome Custom tab was shown and the user successfully authenticated with the oauth2 provider. |
|
abstract fun usernamePasswordLogin(username: String, password: String): LiveData<SimpleResponse<Void>>
Login the user with direct username (usually a username or email) and password. |