IDKit

object IDKit : CloudSDKKoinComponent

Functions

authorize
Link copied to clipboard
fun authorize(): Intent

Creates an authorization request Intent that can be launched using the Activity Result API and a StartActivityForResult contract or with android.app.Activity.startActivityForResult to open a Chrome Custom Tab.

suspend fun authorize(activity: AppCompatActivity, completion: (Completion<String?>) -> Unit = {})
suspend fun authorize(fragment: Fragment, completion: (Completion<String?>) -> Unit = {})

Sends an authorization request to the authorization service, using a Chrome Custom Tab and handles the authorization response automatically.

fun authorize(completedActivity: Class<*>, canceledActivity: Class<*>)

Sends an authorization request to the authorization service, using a Chrome Custom Tab. Upon completion of this authorization request, a PendingIntent of the completedActivity will be invoked. If the user cancels the authorization request, a PendingIntent of the canceledActivity will be invoked.

cachedToken
Link copied to clipboard
fun cachedToken(): String?

Returns the cached accessToken of the current session or null if the session is not initialized or has no accessToken.

containsAuthorizationResponse
Link copied to clipboard
fun containsAuthorizationResponse(intent: Intent): Boolean

Checks if the intent contains an authorization response.

containsEndSessionResponse
Link copied to clipboard
fun containsEndSessionResponse(intent: Intent): Boolean

Checks if the intent contains an end session response.

containsException
Link copied to clipboard
fun containsException(intent: Intent): Boolean

Checks if the intent contains an authorization/end session exception.

disableBiometricAuthentication
Link copied to clipboard
fun disableBiometricAuthentication()

Disables biometric authentication for the current user.

discoverConfiguration
Link copied to clipboard
fun discoverConfiguration(issuerUri: String, completion: (Completion<ServiceConfiguration>) -> Unit)

Performs a discovery to retrieve a ServiceConfiguration.

enableBiometricAuthentication
Link copied to clipboard
fun enableBiometricAuthentication(completion: (Completion<Boolean>) -> Unit)

Enables biometric authentication without passing credentials for the current user.

enableBiometricAuthenticationWithOTP
Link copied to clipboard
fun enableBiometricAuthenticationWithOTP(otp: String, completion: (Completion<Boolean>) -> Unit)

Enables biometric authentication for the current user using mail OTP.

fun enableBiometricAuthenticationWithPassword(password: String, completion: (Completion<Boolean>) -> Unit)

Enables biometric authentication for the current user using the account password.

enableBiometricAuthenticationWithPIN
Link copied to clipboard
fun enableBiometricAuthenticationWithPIN(pin: String, completion: (Completion<Boolean>) -> Unit)

Enables biometric authentication for the current user using the PIN.

endSession
Link copied to clipboard
fun endSession(): Intent?

Creates an end session request Intent that can be launched using the Activity Result API and a StartActivityForResult contract or with android.app.Activity.startActivityForResult to open a Chrome Custom Tab.

suspend fun endSession(activity: AppCompatActivity, completion: (Completion<Unit>) -> Unit = {})
suspend fun endSession(fragment: Fragment, completion: (Completion<Unit>) -> Unit = {})

Sends an end session request to the authorization service, using a Chrome Custom Tab and handles the end session response automatically.

fun endSession(completedActivity: Class<*>, canceledActivity: Class<*>): Boolean

Sends an end session request to the authorization service, using a Chrome Custom Tab. Upon completion of this end session request, a PendingIntent of the completedActivity will be invoked. If the user cancels the end session request, a PendingIntent of the canceledActivity will be invoked.

getAdditionalParameters
Link copied to clipboard
fun getAdditionalParameters(): Map<String, String>?

Returns the additional parameters map.

getKoin
Link copied to clipboard
open override fun getKoin(): Koin
getTransactions
Link copied to clipboard
fun getTransactions(completion: (Completion<Transactions>) -> Unit)

Fetches a list of transactions for the current user sorted in descending order by creation date.

getValidPaymentMethods
Link copied to clipboard
fun getValidPaymentMethods(completion: (Completion<PaymentMethods>) -> Unit)

Fetches a list of valid payment methods for the current user.

handleAuthorizationResponse
Link copied to clipboard
fun handleAuthorizationResponse(intent: Intent, completion: (Completion<String?>) -> Unit)

Sends a request to the authorization service to exchange a code granted as part of an authorization request for a token.

handleEndSessionResponse
Link copied to clipboard
fun handleEndSessionResponse(intent: Intent, completion: (Completion<Unit>) -> Unit)

Resets the local session object.

isAuthorizationValid
Link copied to clipboard
fun isAuthorizationValid(): Boolean

Checks the current authorization state. Returning true does not mean that the access is fresh - just that it was valid the last time it was used.

isBiometricAuthenticationEnabled
Link copied to clipboard
fun isBiometricAuthenticationEnabled(): Boolean

Checks if biometric authentication is enabled for the current user.

isPasswordSet
Link copied to clipboard
fun isPasswordSet(completion: (Completion<Boolean>) -> Unit)

Checks if there is an active password set for the currently authenticated user.

isPINOrPasswordSet
Link copied to clipboard
fun isPINOrPasswordSet(completion: (Completion<PinOrPassword>) -> Unit)

Checks if there is an active PIN or password set and verified for the currently authenticated user.

isPINSet
Link copied to clipboard
fun isPINSet(completion: (Completion<Boolean>) -> Unit)

Checks if there is an active PIN set for the currently authenticated user.

isPINValid
Link copied to clipboard
fun isPINValid(pin: String): Boolean

Checks if the pin is valid. The following rules apply to verify the PIN:

refreshToken
Link copied to clipboard
fun refreshToken(force: Boolean = false, completion: (Completion<String?>) -> Unit = {})

Refreshes the current access token if needed.

sendMailOTP
Link copied to clipboard
fun sendMailOTP(completion: (Completion<Boolean>) -> Unit)

Sends a mail to the user that provides an OTP.

setAdditionalParameters
Link copied to clipboard
fun setAdditionalParameters(params: Map<String, String>?)

Replaces the additional parameters property of the OIDConfiguration with this values.

setPINWithBiometry
Link copied to clipboard
fun setPINWithBiometry(fragment: Fragment, title: String, subtitle: String? = null, cancelText: String? = null, isDeviceCredentialsAllowed: Boolean = true, pin: String, completion: (Completion<Boolean>) -> Unit)
fun setPINWithBiometry(activity: FragmentActivity, title: String, subtitle: String? = null, cancelText: String? = null, isDeviceCredentialsAllowed: Boolean = true, pin: String, completion: (Completion<Boolean>) -> Unit)

Sets or updates the user's PIN using biometric authentication.

setPINWithOTP
Link copied to clipboard
fun setPINWithOTP(pin: String, otp: String, completion: (Completion<Boolean>) -> Unit)

Sets or updates the user's PIN using mail OTP.

setPINWithPassword
Link copied to clipboard
fun setPINWithPassword(pin: String, password: String, completion: (Completion<Boolean>) -> Unit)

Sets or updates the user's PIN using the account password.

userInfo
Link copied to clipboard
fun userInfo(accessToken: String, completion: (Completion<UserInfoResponse>) -> Unit)

Retrieves the currently authorized user's information.