View as Markdown

Identify · Guide

Add a vendor score

Add a bot-detection vendor's judgement to every verdict with your own key. Identify reports it as vendor_score, labelled with the vendor's name, next to its own rule-based bot_score and never merged with it. Provenance adds no markup to your vendor plan.

Before you begin: a Fingerprint account with Bot Detection, its secret Server API key, and its JavaScript agent on your pages sending each visit's requestId to your server in the x-fingerprint-request-id header.

VendorWhere it runsKey
FingerprintThe hosted check, the Node and Python middleware, the edge templatesYours
Cloudflare Bot ManagementThe Cloudflare Worker templateNone; read from the request

1. Store your key for the hosted check

export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5

curl -s -X PATCH $PROVENANCE_API/v1/identify/vendors/fingerprint \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "api_key": "fp_live_secret_example_0001", "region": "us" }'
{ "id": "fingerprint", "object": "identify_vendor", "configured": true, "region": "us", "key_last4": "0001" }

The key is encrypted at rest and never returned.

2. Or pass it to the middleware

The middleware calls Fingerprint from your own servers, so the key stays in your environment:

import { Identify } from "@provenanceauth/identify";
import { fingerprintProvider } from "@provenanceauth/identify/vendors";

const fp = fingerprintProvider({ apiKey: process.env.FINGERPRINT_SECRET_KEY!, region: "us" });
const identify = new Identify({ apiKey: process.env.PROVENANCE_KEY, vendorScore: (req) => fp.score(req) });

3. Read vendor_score

statusMeaning
okscore is 1 for Fingerprint's bad or good (a known bot) and 0 for notDetected; label is Fingerprint's answer.
absentThe request carried no Fingerprint requestId.
not_configuredNo key is set.
errorFingerprint answered with an error; message says what.
quota_exhaustedYour Fingerprint plan's limit was reached.

Nothing is ever scored in a vendor's place. A signed agent stays signed_agent whatever its vendor score.

4. Act on it in your policy

{ "id": "block-vendor-bad", "when": [{ "fact": "agent.class", "op": "ne", "value": "signed_agent" }, { "fact": "vendor_score", "op": "gte", "value": 1 }], "then": { "action": "challenge" } }

5. Remove the key

Remove the key to stop scoring; verdicts then report not_configured.

curl -s -X DELETE $PROVENANCE_API/v1/identify/vendors/fingerprint \
  -H "Authorization: Bearer $PROVENANCE_KEY"
{ "id": "fingerprint", "object": "identify_vendor", "deleted": true }

Errors you might see

SymptomCauseFix
503 identify_vendor_not_configured on the key testNo key is storedStore it (step 1).
502 identify_vendor_error on the key testFingerprint refused the key or the request idCheck the key and the region in Fingerprint's dashboard.
vendor_score.status is always absentYour pages don't send the requestIdForward it in x-fingerprint-request-id.

See also