signupWithWebAuthn
client.signupWithWebAuthn(
profile,
origin,
signupRequestCode,
successWithWebAuthnId,
failure,
// Optional arguments
friendlyName
)
About this command
The user requests to register a new account for the first time. This method retrieves a FIDO2 pending intent for signup with the options returned by the ReachFive server and launches it.
The result is then processed by the onSignupWithWebAuthnResult method.
| The WebAuthn feature must be enabled on your ReachFive account. |
Examples
private lateinit var webAuthnId: String
val WEBAUTHN_SIGNUP_REQUEST_CODE = 3
client.signupWithWebAuthn(
profile = ProfileWebAuthnSignupRequest(
givenName = "John",
familyName = "Doe",
gender = "male",
email = "john.doe@gmail.com"
),
origin = "https://dev-sandbox-268508.web.app",
friendlyName = "Nexus 5"
signupRequestCode = WEBAUTHN_SIGNUP_REQUEST_CODE,
successWithWebAuthnId = { this.webAuthnId = it }, // Store the webautn ID in the activity class
failure = { error -> ... } // Return a ReachFive error
)
Parameters
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. |
|||||||||||||||||||||||||||||||||||||||||
The profile data.
|
|||||||||||||||||||||||||||||||||||||||||
Identifies the return result of the FIDO2 signup when the result arrives. |
|||||||||||||||||||||||||||||||||||||||||
Callback called once the request has succeeded. You’ll get the WebAuthn identifier of the user as an argument. |
Response
Type: Unit
ReachFiveError
message |
The message of the error. |
||||||||||||||
code |
The code from the underlying WebAuthn library. See WebAuthn errors for more details. |
||||||||||||||
exception |
The stack trace of the error. |
||||||||||||||
data |
Additional data about the error.
|