DeviceBindingCallback

Callback to collect the device binding information

Constructors

Link copied to clipboard
constructor(jsonObject: JSONObject, index: Int)
constructor()

Properties

Link copied to clipboard
protected var _id: Int
Link copied to clipboard
lateinit var attestation: Attestation

Enable Attestation

Link copied to clipboard
lateinit var challenge: String

The challenge received from server

Link copied to clipboard
protected var content: String
Link copied to clipboard
lateinit var description: String

The description to be displayed in biometric prompt

Link copied to clipboard

The authentication type of the journey

Link copied to clipboard
lateinit var subtitle: String

The subtitle to be displayed in biometric prompt

Link copied to clipboard
var timeout: Int?

The timeout to be to expire the biometric authentication

Link copied to clipboard
lateinit var title: String

The title to be displayed in biometric prompt

Link copied to clipboard
lateinit var userId: String

The userId received from server

Link copied to clipboard
lateinit var userName: String

The userName received from server

Functions

Link copied to clipboard
open suspend fun bind(context: Context, prompt: Prompt? = null, deviceAuthenticator: (type: DeviceBindingAuthenticationType) -> DeviceAuthenticator = deviceAuthenticatorIdentifier)
open fun bind(context: Context, deviceAuthenticator: (type: DeviceBindingAuthenticationType) -> DeviceAuthenticator = deviceAuthenticatorIdentifier, listener: FRListener<Void?>, prompt: Prompt? = null)

Bind the device. Calling the bind function, the existing bounded keys will be removed. If don't want to replace or remove existing keys, please use FRUserKeys to check existing keys before calling this method

Link copied to clipboard
private fun clearKeys(context: Context, deviceAuthenticator: DeviceAuthenticator)

For now we don't support multiple keys, so before we create new keys, we clean existing keys.

Link copied to clipboard
internal suspend fun execute(context: Context, deviceAuthenticator: DeviceAuthenticator = getDeviceAuthenticator( deviceBindingAuthenticationType), deviceBindingRepository: DeviceBindingRepository = LocalDeviceBindingRepository( context), deviceId: String = DeviceIdentifier.builder().context(context) .build().identifier, prompt: Prompt? = null)

Helper method to execute binding , signing, show biometric prompt.

Link copied to clipboard
open override fun get_id(): Int

Return the unique id for this callback. The id only available with Callback that using PageCallback

Link copied to clipboard
open override fun getContent(): String

Return the raw content of the Callback.

Link copied to clipboard
protected open fun getContentAsJson(): JSONObject
Link copied to clipboard
open fun getCryptoKey(): CryptoKey
Link copied to clipboard

Create the interface for the Authentication type(Biometric, Biometric_Fallback, none)

Link copied to clipboard
open fun getDuration(timeout: Int?): Duration

Convert timeout in seconds to Duration

Link copied to clipboard
open fun getExpiration(timeout: Int?): Date

Get Expiration date for the signed token, claim "exp" will be set to the JWS.

Link copied to clipboard
private open fun getInput(content: JSONObject, index: Int): JSONObject
Link copied to clipboard
open fun getInputValue(): Any

Get the first value for input

open fun getInputValue(index: Int): Any

Get the value for input

Link copied to clipboard
protected open fun getName(jsonObject: JSONObject): String
Link copied to clipboard
open override fun getType(): String

Return the type of the Callback, the type name should align with the Callback type returned from AM

Link copied to clipboard

Handle all the errors for the device binding.

Link copied to clipboard
protected override fun setAttribute(name: String, value: Any)
Link copied to clipboard
open override fun setClientError(value: String?)

Input the Client Error to the server

Link copied to clipboard
protected open fun setContent(jsonObject: JSONObject)

Sets the value of the Callback

Link copied to clipboard
fun setDeviceId(value: String?)

Input the Device Id to the server

Link copied to clipboard
fun setDeviceName(value: String?)

Input the Device Name to the server

Link copied to clipboard
fun setJws(value: String?)

Input the JWS key to the server

Link copied to clipboard
protected open fun setValue(value: Any)

Set the first value for input

protected open fun setValue(value: Any, index: Int)

Set the value for the input.