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.
| Vendor | Where it runs | Key |
|---|---|---|
| Fingerprint | The hosted check, the Node and Python middleware, the edge templates | Yours |
| Cloudflare Bot Management | The Cloudflare Worker template | None; 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" }'
await fetch(`${process.env.PROVENANCE_API}/v1/identify/vendors/fingerprint`, {
method: "PATCH",
headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ api_key: process.env.FINGERPRINT_SECRET_KEY, region: "us" }),
});
import os, httpx
httpx.patch(f"{os.environ['PROVENANCE_API']}/v1/identify/vendors/fingerprint",
headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"},
json={"api_key": os.environ["FINGERPRINT_SECRET_KEY"], "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
status | Meaning |
|---|---|
ok | score is 1 for Fingerprint's bad or good (a known bot) and 0 for notDetected; label is Fingerprint's answer. |
absent | The request carried no Fingerprint requestId. |
not_ | No key is set. |
error | Fingerprint answered with an error; message says what. |
quota_ | Your 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"
await fetch(`${process.env.PROVENANCE_API}/v1/identify/vendors/fingerprint`, {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}` },
});
httpx.delete(f"{os.environ['PROVENANCE_API']}/v1/identify/vendors/fingerprint",
headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"})
{ "id": "fingerprint", "object": "identify_vendor", "deleted": true }
Errors you might see
| Symptom | Cause | Fix |
|---|---|---|
503 identify_ on the key test | No key is stored | Store it (step 1). |
502 identify_ on the key test | Fingerprint refused the key or the request id | Check the key and the region in Fingerprint's dashboard. |
vendor_ is always absent | Your pages don't send the requestId | Forward it in x-fingerprint-request-id. |
See also
- Run Identify at the edge: Cloudflare's score
- Write a traffic policy
- Signals and categories