Handle web biometrics
The ForgeRock JavaScript SDK has two methods for handling web biometrics:
FRWebAuthn.register()
-
For registering devices.
FRWebAuthn.authenticate()
-
For authenticating using a previously registered device.
Use the FRWebAuthn.getWebAuthnStepType()
convenience method to determine which method to use:
// Determine if a step is a web biometrics step
const stepType = FRWebAuthn.getWebAuthnStepType(step);
if (stepType === WebAuthnStepType.Registration) {
// Registering a new device
step = await FRWebAuthn.register(step);
} else if (stepType === WebAuthnStepType.Authentication) {
// Authenticating with a registered device
step = await FRWebAuthn.authenticate(step);
}
// `step` has now been populated with the web biometrics credentials
// Send this new step to the ForgeRock server
nextStep = FRAuth.next(step);