OAuthProvider

interface OAuthProvider

This interface provides definitions for all methods required to interact with the Sensibill OAuth service.

Types

AccessTokenCallback
Link copied to clipboard
interface AccessTokenCallback
Companion
Link copied to clipboard
object Companion
ForgetPasswordCallback
Link copied to clipboard
interface ForgetPasswordCallback
LogoutCallback
Link copied to clipboard
interface LogoutCallback

Functions

authenticateUser
Link copied to clipboard
open fun authenticateUser(oauthSettings: OAuthSettings, username: String, password: String, callback: OAuthProvider.AccessTokenCallback)
Authenticates user using username and password, and returns User Session (AccessToken + RefreshToken + Token details, ie expiry) through AccessTokenCallback
abstract fun authenticateUser(oauthSettings: OAuthSettings, username: String, password: String, callback: OAuthProvider.AccessTokenCallback, callbackScope: CoroutineScope)
forgotPassword
Link copied to clipboard
open fun forgotPassword(email: String, callback: OAuthProvider.ForgetPasswordCallback)
Use to trigger Forgot Password email to user email
abstract fun forgotPassword(email: String, callback: OAuthProvider.ForgetPasswordCallback, callbackScope: CoroutineScope)
getClientToken
Link copied to clipboard
open fun getClientToken(oauthSettings: OAuthSettings, callback: OAuthProvider.AccessTokenCallback)
Use client settings to generate Client Access Token
abstract fun getClientToken(oauthSettings: OAuthSettings, callback: OAuthProvider.AccessTokenCallback, callbackScope: CoroutineScope)
logout
Link copied to clipboard
open fun logout(accessToken: String, logoutCallback: OAuthProvider.LogoutCallback)
Performs user logout, invalidates user access token
abstract fun logout(accessToken: String, logoutCallback: OAuthProvider.LogoutCallback, callbackScope: CoroutineScope)
refreshToken
Link copied to clipboard
open fun refreshToken(refreshToken: String, oauthSettings: OAuthSettings, accessTokenCallback: OAuthProvider.AccessTokenCallback)
Use refresh token to get new access token
abstract fun refreshToken(refreshToken: String, oauthSettings: OAuthSettings, accessTokenCallback: OAuthProvider.AccessTokenCallback, callbackScope: CoroutineScope)

Inheritors

OAuthProviderImpl
Link copied to clipboard