Skip to main content
Device Permissions1 min read

Biometric Authentication (Face ID and Fingerprint)

Let users confirm their identity with Face ID, Touch ID or fingerprint from your website, with the biometric permission and wapp.biometrics.authenticate.

Overview

Biometric authentication lets your website ask the user to confirm their identity with Face ID or Touch ID on iPhone, or the fingerprint or face unlock on Android, for example before showing account details or confirming a payment.

Turn it on

  1. Open Permissions › Device and turn on Biometric Authentication for the platforms you want.
  2. On iOS, review the Face ID purpose string.
  3. Save and start a new build.

Call it from your website

javascript
async function confirmIdentity() {
  if (!window.wapp) return false; // not in the app: use your normal sign-in

  const result = await wapp.biometrics.authenticate({
    reason: 'Confirm it is you to view your orders',
  });

  if (result.success) return true;          // verified on this device
  if (result.code === 'CANCELLED') return false; // user closed the prompt
  return false;                                  // AUTH_FAILED or NOT_CONFIGURED
}

The optional reason (up to 200 characters) is shown in the prompt.

ResultMeaning
{ success: true, status: 'authenticated' }The user passed the check
CANCELLEDThe user closed the prompt
AUTH_FAILEDThe check failed
NOT_CONFIGUREDBiometrics are not available: the permission is off in this build, or the phone has no biometrics set up (details.reason)

Important: what it proves

Biometric authentication confirms that the person holding the phone is its owner. It does not sign the user in to your website by itself. Use it as an extra confirmation on top of your existing session, for example to unlock a remembered session or approve a sensitive action. Keep your own server-side checks.

Older code

Websites written for earlier versions may call window.WebAppStudio.authenticate({ reason }). That still works; use wapp.biometrics.authenticate for new code.

Next steps