View as Markdown

Mandate · Guide

Require a passkey

Use biometric approval to prove a person was present when an action was approved. The person confirms with a passkey on their device (face, fingerprint or device PIN), Provenance verifies the signed result, and only then does the token carry biometric_bound: true. A policy rule can require it.

Before you begin: export the full-access sandbox key, which has the admin scope for device enrollment and the mandate scope for authorize. The passkey steps run in a browser on a device with a platform authenticator, served from the domain your Provenance server is configured for.

export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
  1. Enroll once
    passkey registered to the device
  2. Each approval
    challenge → passkey check → assertion
  3. Token
    biometric_bound: true

1. Get an enrollment challenge

Registration answers a one-time challenge from POST /v1/admin/devices/enrollment_challenge. It expires after 10 minutes.

curl -s -X POST $PROVENANCE_API/v1/admin/devices/enrollment_challenge \
  -H "Authorization: Bearer $PROVENANCE_KEY" | tee enrollment.json
{
  "object": "enrollment_challenge",
  "challenge": "l-0I_oYv2HlBJzNgJ_32LdnJfi-clZfHMnlIc90HIuA",
  "expires_at": "2026-10-24T13:50:51.162Z"
}

2. Register the passkey and enroll the device

In the browser, create a passkey over the challenge with navigator.credentials.create, requiring user verification so the device asks for the biometric. Send the result to your backend, which enrolls the device at POST /v1/admin/devices with webauthn_registration.

const b64u = (buf: ArrayBuffer) => btoa(String.fromCharCode(...new Uint8Array(buf))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
const fromB64u = (s: string) => Uint8Array.from(atob(s.replace(/-/g, "+").replace(/_/g, "/")), (c) => c.charCodeAt(0));

const credential = (await navigator.credentials.create({
  publicKey: {
    challenge: fromB64u(challenge),
    rp: { id: location.hostname, name: "Example Bank" },
    user: { id: crypto.getRandomValues(new Uint8Array(16)), name: "dana@example.com", displayName: "Dana" },
    pubKeyCredParams: [{ type: "public-key", alg: -7 }],
    authenticatorSelection: { authenticatorAttachment: "platform", userVerification: "required" },
  },
})) as PublicKeyCredential;
const response = credential.response as AuthenticatorAttestationResponse;
const webauthnRegistration = {
  challenge,
  attestationObject: b64u(response.attestationObject),
  clientDataJson: b64u(response.clientDataJSON),
};

Your backend enrolls the device with it:

curl $PROVENANCE_API/v1/admin/devices \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{ \"webauthn_registration\": $(cat registration.json) }"

The response is the enrolled device. Keep its device_id: it's the device you name at authorize.

3. Get a biometric challenge for the approval

Each authorization answers a fresh challenge from POST /v1/mandate/biometric_challenges. A challenge works once and expires after five minutes.

curl -s -X POST $PROVENANCE_API/v1/mandate/biometric_challenges \
  -H "Authorization: Bearer $PROVENANCE_KEY"
{
  "object": "biometric_challenge",
  "challenge": "Ges6jEttTznIA0Q73-KbzeI6pct_n2UNdfsEONcxxmA",
  "expires_at": "2026-10-24T13:45:51.177Z"
}

4. Sign the challenge and authorize

In the browser, show the person the action and run navigator.credentials.get over the challenge. The device prompts for face or fingerprint and signs the challenge with the passkey.

const assertion = (await navigator.credentials.get({
  publicKey: { challenge: fromB64u(approvalChallenge), rpId: location.hostname, userVerification: "required" },
})) as PublicKeyCredential;
const signed = assertion.response as AuthenticatorAssertionResponse;
const biometricAssertion = {
  authenticatorData: b64u(signed.authenticatorData),
  clientDataJson: b64u(signed.clientDataJSON),
  signature: b64u(signed.signature),
};

Authorize with the challenge and the assertion. Provenance checks that the enrolled passkey signed this exact challenge, from your domain, with the person verified, before it mints the token:

curl $PROVENANCE_API/v1/mandate/intents \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"action_description\": \"Wire \$12,000 to Acme Corp for PO-7781\",
    \"agent_session_id\": \"sess_treasury_1\",
    \"device_id\": \"$DEVICE_ID\",
    \"biometric_challenge\": \"$APPROVAL_CHALLENGE\",
    \"biometric_assertion\": $(cat assertion.json)
  }"
{
  "object": "intent_authorization",
  "intent_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ijc1MjY5NmZmMGY1ZTRmNTMifQ.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSJ9.dUvSg20-l4xn1dRTrhQTU8F0W9tRDWpE1INz793rICt-daFn5wVgd0SndvqNIquHFUih1aFMJ24rCoZCMq3AOA",
  "expires_at": "2026-10-24T17:44:02.000Z",
  "attestation_id": "4a1d2c6e-9b0f-4e57-8d3a-1f6c2b7e9a40",
  "biometric_bound": true
}

A missing, forged or reused assertion gives biometric_bound: false; authorize doesn't fail, so your policy decides. Native apps get the same assertion from the capture SDK, signed in the phone's secure hardware.

5. Require it in policy

A rule with require: { biometric: true } refuses a token without a verified passkey check. Try one with POST /v1/mandate/policies/simulate, which uses the account key and changes nothing:

curl $PROVENANCE_API/v1/mandate/policies/simulate \
  -H "Authorization: Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" \
  -H "Content-Type: application/json" \
  -d '{
    "document": { "rules": [{ "id": "wires-need-passkey", "when": [{ "fact": "action_type", "op": "eq", "value": "wire" }], "require": { "biometric": true } }] },
    "facts": { "action_type": "wire", "biometric_bound": false }
  }'
{
  "object": "policy_simulation",
  "domain": "intent",
  "allowed": false,
  "reason": "policy_biometric_required",
  "policy": {
    "id": "pol_3F9A1C7E52B04D8E6A1F27C9B4",
    "version": 0,
    "rule": {
      "id": "wires-need-passkey",
      "name": null,
      "phase": "assess",
      "action": "reject",
      "conditions": [
        { "fact": "action_type", "op": "eq", "value": "wire", "actual": "wire" }
      ]
    }
  }
}

To ask for the passkey only when the action is sent for approval, combine "approval": true with "biometric": true. Then the approver's passkey check, on the approval page or in the console, satisfies the rule instead of the token's; see step-up approval.

A passkey belongs to the site that made it, so your own site can't make one for Provenance. To name your customer's phone on their grant, ask for an enrollment link at POST /v1/mandate/device_enrollments with your mandate key. Show enroll_url as a QR code, or text short_url. The person opens it on the phone and makes a passkey on Provenance's page. The link works once, for 15 minutes by default.

curl -s -X POST $PROVENANCE_API/v1/mandate/device_enrollments \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "display_name": "Maya", "reference": "customer_2041" }' | tee enrollment.json

Read it back until status is enrolled, then name device_id on the person's grant. Their plan approvals, raises and step-ups are then approved by that phone's passkey.

curl $PROVENANCE_API/v1/mandate/device_enrollments/$(jq -r .id enrollment.json) \
  -H "Authorization: Bearer $PROVENANCE_KEY"

To discard the phone, revoke the enrollment at POST /v1/mandate/device_enrollments/{id}/revoke: a pending link stops working, and an enrolled phone's device is revoked, so its passkey approves nothing after. A second completion of the same link is 409 device_enrollment_closed.

Errors you might see

SymptomCauseFix
biometric_bound: false with an assertionThe assertion didn't verify: a reused or expired challenge, another device's passkey, or the user-verified flag missingGet a fresh challenge and require userVerification: "required".
NotAllowedError in the browserThe person cancelled, or the page's domain doesn't match the server's configured domainRetry; serve the page from the configured domain.
400 parameter_invalid on webauthn_registrationThe registration didn't verify or its challenge expiredGet a new enrollment challenge and register again.
409 device_enrollment_closedThe enrollment link already enrolled a phone, was revoked or expiredRead the enrollment; make a new link for another phone.
valid: false, policy_biometric_required at verifyThe rule requires a passkey and the token has noneAuthorize again with a biometric assertion.

See also