addNewWebAuthnDevice
client.addNewWebAuthnDevice( authToken, origin, failure, activity, // Optional arguments friendlyName )
About this command
When authenticated, the user can add a new FIDO2 device. This method will get a FIDO2 pending intent for registration with the options returned by the ReachFive server and launch it.
The result will be processed by the onAddNewWebAuthnDeviceResult method.
|
Examples
import com.reach5.identity.sdk.core.models.AuthToken
val WEBAUTHN_REGISTER_REQUEST_CODE = 1
val authToken: AuthToken = // The authentication token obtained following signup or login.
client.addNewWebAuthnDevice(
authToken = authToken,
origin = "https://dev-sandbox-268508.web.app",
friendlyName = "Nexus 5"
registerRequestCode = WEBAUTHN_REGISTER_REQUEST_CODE,
failure = { error -> ... } // Handle a ReachFive error
)
Parameters
The Android activity. |
|||||||||||||
Authorization token of the profile retrieved from login.
|
|||||||||||||
Callback called once the request has failed. You’ll get a |
|||||||||||||
The name of the FIDO2 device. Each device must have a unique name. Default to the name of the Android product. |
|||||||||||||
The domain of the origin. |
Response
Type: Unit
ReachFiveError
message |
The message of the error. |
|||||||||||||||||||||||||||||||||||||||
getErrorCode() |
The error code’s enumeration value. |
|||||||||||||||||||||||||||||||||||||||
code |
The code from the underlying WebAuthn library.
|
|||||||||||||||||||||||||||||||||||||||
exception |
The stack trace of the error. |
|||||||||||||||||||||||||||||||||||||||
data |
Additional data about the error.
|