View as Markdown

Authorize · Guide

Verify a Provenance token

Use offline verification when you receive an intent token from someone else, such as a merchant, a bank or another agent, and want to check it without a Provenance API key. Tokens are signed with ES256 and the public keys are published, so you check the signature and expiry yourself. Intent tokens and receipts explains what each token and receipt holds.

Three guides cover agent orders. Pick the one that matches your job:

You want toGuide
Check one intent token or receipt you received, offline against the published keys or with POST /v1/verifyVerify a token
Get one outcome per agent order (approved, challenged or rejected) from your own checkout rules, shaped like a 3-D Secure resultAssess an agent checkout
Check the cart-bound token and grant a shopping agent presents at your own checkout, with the verifyAgentCheckout helperVerify agent checkouts

Before you begin: export the full-access sandbox key to get a token to check. Steps 2 to 4 need no key.

export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
CheckOfflineWith the API
Signed by Provenance and not expiredYesYes
Not revokedKeyless status check (step 4)POST /v1/mandate/assessments
Description and payload match what was approvedNoPOST /v1/mandate/assessments
Policy and approvalsNoPOST /v1/mandate/assessments

1. Get a token to check

In production the token arrives with the request you're about to honor. Here you mint one:

curl -s $PROVENANCE_API/v1/mandate/intents \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action_description": "Pay invoice INV-2041: $1,850.00 to Brindlecote Supplies",
    "agent_session_id": "sess_offline_1",
    "device_id": "dev_00000000000000000000000000000001"
  }' | tee authorization.json
export INTENT_TOKEN=$(jq -r .intent_token authorization.json)
export JTI=$(jq -r .attestation_id authorization.json)
{
  "object": "intent_authorization",
  "intent_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ijc1MjY5NmZmMGY1ZTRmNTMifQ.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSJ9.dUvSg20-l4xn1dRTrhQTU8F0W9tRDWpE1INz793rICt-daFn5wVgd0SndvqNIquHFUih1aFMJ24rCoZCMq3AOA",
  "expires_at": "2026-10-24T17:36:45.000Z",
  "attestation_id": "7f79a885-5fc7-4946-a27e-6d5c5dc412d0",
  "biometric_bound": false
}

The token's jti claim is the attestation_id.

2. Fetch the published keys

GET /.well-known/jwks.json is public and can be cached for an hour. During a key rotation it lists both keys, and each token's header names its key in kid.

curl $PROVENANCE_API/.well-known/jwks.json
{
  "keys": [
    { "kty": "EC", "crv": "P-256", "x": "BK6V-uOw7SR4VDlKGwHj2eQpv5ZC5PwMnsrJhLoGVLQ", "y": "w7xDNaHuUjpEnYwC9u5p1Mosjw6ChXISYi7ojgjsUTc", "kid": "752696ff0f5e4f53", "use": "sig", "alg": "ES256" }
  ]
}

3. Verify the signature and expiry

The SDK verifiers use the platform's own crypto, so they run in Node, the browser and Python with no API key:

import { verifyIntentTokenOffline } from "@provenanceauth/sdk";

const result = await verifyIntentTokenOffline(token, jwks);
if (result.valid) console.log("authorized for subject", result.payload?.sub, "in session", result.payload?.session);

The result has valid, expired, the token's claims in payload, and a reason when it fails. Any standard JOSE library works too, for example jwtVerify from jose with algorithms: ["ES256"]. To check without code, paste the token into the console's Verify a proof page.

Only ES256 is accepted. Pin the algorithm to ES256 and pick the key by the header kid before you check the signature. The API does the same: a token with any other alg, including HS256 or none, fails POST /v1/mandate/assessments with reason invalid_token.

The claims you'll use most:

jtistring
The token's ID, used for revocation checks.
substring
An opaque subject for the person who approved, never their device id. A token minted with an audience carries a pairwise subject (psub_…): the same for one device at your site and unrelated at every other site, so you can count or block repeat approvals without linking the person elsewhere. A token minted without one carries a per-token subject (anon_…). Tokens minted before October 2026 carry the device's UUID until they expire.
audstring
The one site the token is for, when the agent named one. Accept the token only when it names your origin or merchant id.
action_hashstring
SHA-256 of the approved action_description. Hash the description you received and compare.
payload_hashstring
SHA-256 of the canonical JSON of the approved payload, when one was bound.
confirmedobject
When a person approved the action (at) and how it reached them (via). Present only when a person approved. How they approved (the method, the biometric, the device tier) is in the paid check, POST /v1/authorize/verifications.
agentobject
The registered agent's display name (name). Present when a registered agent asked.
riskobject
A coarse risk read at mint: score (0 to 100) and action (allow, review or block).
expinteger
Expiry, four hours after issue.

4. Check revocation before a high-value action

A token can be revoked before it expires, and an offline check can't see that. The free POST /v1/verify needs no key: it checks the signature, the issuer, the expiry and revocation, and answers with the token's free claims:

curl -s -X POST $PROVENANCE_API/v1/verify \
  -H "Content-Type: application/json" \
  -d "{\"token\":\"$INTENT_TOKEN\"}"
{ "object": "verification_result", "valid": true, "reason": null, "kind": "intent", "binding": "not_checked", "revoked": false, "confirmed": null }

Approval holds

A token is signed when the agent asks for it, before anyone approves it. When the issuer's rules ask a person (require.approval), the agent's first decision opens the approval. Until the person approves, every check of the token answers valid: false: the free POST /v1/verify, the paid POST /v1/authorize/verifications, checkout assessments and the @provenanceauth/rails verifiers.

reasonWhat happenedWhat to do
approval_pendingThe person hasn't answered yet.Hold the order and check again after they answer.
approval_deniedThe person declined it.Don't run the action or ship the order.
approval_expiredNobody answered before the approval expired.Ask the agent to authorize again.
approval_changes_requestedThe person asked for a change.Wait for the agent's revised token.
option_not_chosenThe person chose a different option of the same request.Run only the chosen option.

A hold is a status, like revocation. The free check names the reason only, never the method, the biometric, the device tier or who approved. The paid check also names the approval (approval.id). Once the person approves, the token verifies, and confirmed says when they said yes (via: "approval"), even when they approved after the token was minted. confirmed is null when a rule alone allowed the action.

An agent that never calls its own decision has no approval to report, so its token verifies when nothing asked a person. To require a person's yes on every order, read confirmed, or pass require.confirmed to verifyAgentCheckout.

If you hold a key for the issuing account, POST /v1/mandate/assessments runs every check at once, including the description and payload binding.

5. Choose the free check or the paid one

POST /v1/verify verifies any Provenance token for free: an intent token, a grant token or a signed receipt. Send expected.action_payload to have it compare the payload too; binding then says match or mismatch. It answers with the token's free claims only (the ones listed in step 3) and never the approval detail. It allows 120 requests a minute per IP address; past that it answers 429.

A merchant that needs to know how the person approved calls POST /v1/authorize/verifications with its own key. It runs the same checks, applies your checkout rules, and adds the approval detail Provenance keeps on its side: the method, whether it was biometric, the device's trust tier and the agent's registration. Each call is metered as one Authorize check.

CheckKeyAnswers with
Offline (steps 2 and 3)NoneSignature and expiry
POST /v1/verifyNoneSignature, expiry, revocation, approval holds, binding and the free claims
POST /v1/authorize/verificationsYour account keyAll of that, your checkout rules and how the person approved

Errors you might see

SymptomCauseFix
valid: false, reason unknown kidYour cached keys predate a rotationFetch the keys again.
valid: false, expired: trueTokens last four hoursAsk the sender to authorize again.
valid: false, reason unsupported algThe token isn't an ES256 intent tokenCheck you were sent an intent token, not a receipt or another JWT.
valid: false, reason approval_pendingThe issuer's rules asked a person, who hasn't answeredHold the order; see approval holds.
429 on the status checkThe keyless status check is rate-limited per IPCache results for the token's lifetime, or verify with a key.

See also