addNewWebAuthnDevice
client.addNewWebAuthnDevice( authToken, origin, registerRequestCode, failure, // 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 profileAuthToken: AuthToken = // Here paste the authorization token of the profile retrieved after login
client.addNewWebAuthnDevice(
authToken = profileAuthToken,
origin = "https://dev-sandbox-268508.web.app",
friendlyName = "Nexus 5"
registerRequestCode = WEBAUTHN_REGISTER_REQUEST_CODE,
failure = { error -> ... } // Return a ReachFive error
)
Parameters
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. |
|||||||||||||
Identifies the return result of the FIDO2 registration when the result arrives. |
Response
Type: Unit
ReachFiveError
message |
The message of the error. |
|||||||||||||||||||||||||||||||||||||||
code |
The code from the underlying WebAuthn library.
|
|||||||||||||||||||||||||||||||||||||||
exception |
The stack trace of the error. |
|||||||||||||||||||||||||||||||||||||||
data |
Additional data about the error.
|