Registration result codes
After the result of the operation is returned, your frontend needs to react accordingly. The result contents enable you to decide whether the registration is successful.
The result has the following members:
Field | Description |
---|---|
success boolean | The member indicates whether the registration is successful. |
code.statusCode enum | The enumeration reports the success code or the various error codes for the session. |
code.message string | A short human-readable message about the result of the transaction. |
token string | You can use the transaction token to verify whether the operation is executed by your Authentication Cloud instance, see Status endpoint. |
message string | Only present in case of an error when it provides a more verbose description of the failure. |
All the registration error codes are in the form of error-10XX
.
On success, the user is considered logged in. For security reasons, check the validity of the response independently of the registration process, by verifying the token using the Authentication Cloud API introspection endpoint. On failure, handle the error as in the following example:
if (result.success) {
// result.code.statusCode ->
// "success-registration" is a successful registation,
// result.message contains more information in a human-readable format.
}
else {
// Handle the error, you can find more details in result.code and result.message
alert("There was a problem: " + result.code.message);
}
Example success result object:
{
"success": true,
"code": {
"statusCode": "success-registration",
"message": "Successfully registered WebAuthn credential."
},
"token": "eyJhbGciOiJIUzUxMiJ9.eyJpc...ifQ.suBhl...cX-lE0_FRKrTDcLA"
}
Example failure result object:
{
"success": false,
"code": {
"statusCode": "error-1001",
"message": "Failed to create WebAuthn credential."
},
"message": "Error while trying to create new credential. NotAllowedError: The operation either timed out or was not allowed. See: https://www.w3.org/TR/webauthn-2/#sctn-privacy-considerations-client."
}
Result code | Description | Comment |
---|---|---|
success-registration | Successfully registered WebAuthn credential. | |
error-1000 | Invalid credentialCreationOptions . ServerPublicKeyCredentialCreationOptions has to be valid. | The credentialCreationOptions object is missing or invalid. Make sure you pass in the credentialCreationOptions , which is returned in the registration response. |
error-1001 | Failed to create WebAuthn credential. | An error prevented creating a WebAuthn credential. See result.message for more information. |
error-1002 | Error while registering the new credential on server | An error occurred while sending the attestation result data to Authentication Cloud API to finalize the registration. See result.message for more information. |
error-1003 | Missing statusToken . Cannot be null or undefined. | The statusToken parameter was missing. Make sure you pass in the statusToken , which is returned in the registration response. |
error-1004 | WebAuthn is not supported by this browser. | Make sure that you use a browser which supports creating and authenticating with a FIDO2 / WebAuthn credential. |
error-1099 | Unknown error while registration. | See result.message for more information. |
Next
You are now ready to take on the API and get going with your own FIDO2 registration flow, see Enrollment.
For more information on how to continue with authentication, see Authenticate using FIDO2.