Field identity protocol
The field-worker plane is a separate identity population from principals and portal users: workers
with a PIN, using devices that hold a key. This page is the device-facing protocol. For the idea see
Field-worker identity; for the claims of the access token see
Token claims; for the administrative API
(/api/field-workers, /api/field-devices, /api/field-policies, /api/field-tokens) see the
HTTP API reference.
The routes are public (mounted outside the platform API middleware: the device proof and the PIN
authenticate them), JSON in and out, camelCase, behind a per-IP governor
(FC_FIELD_RATE_PER_MIN, FC_FIELD_BURST). Every error is {"error": CODE, "message": "..."}.
Without FLOWCATALYST_APP_KEY (the pepper PINs are hashed with) every route answers
503 FIELD_IDENTITY_UNCONFIGURED: the plane fails closed.
Routes
Section titled “Routes”| Route | Request | Success |
|---|---|---|
POST /field/auth/nonce |
{} (proof without a nonce) |
{nonce, expiresAt} |
POST /field/devices/enrol |
{code, publicKeyJwk, attestationChain?, platform, model, label?}; the proof key must be publicKeyJwk |
201 {deviceId, mode, clientId, appCodes[]} |
POST /field/auth/login |
{appCode, clientIdentifier?, workerCode | badgeToken, pin?} |
FieldTokenResponse |
POST /field/auth/refresh |
{refreshToken} |
FieldTokenResponse |
POST /field/auth/pin |
{currentPin, newPin}, Authorization: DPoP <access> |
204 |
POST /field/auth/logout |
{refreshToken, scope: "session" | "device-all"} |
204 |
POST /field/auth/act-as |
{workerCode | workerId, pin}, Authorization: DPoP <supervisor access> |
FieldTokenResponse (for the worker, with act) |
POST /field/auth/sign-in-code |
{code} |
FieldTokenResponse (for the code’s worker, with act) |
POST /field/auth/unlock-keys |
{publicKeyJwk, keyProof, attestationChain?}, Authorization: DPoP <access> |
201 {unlockKeyId, deviceId, workerId, createdAt, pinRequiredBy?, replacedUnlockKeyId?, attestation} |
POST /field/auth/unlock/challenge |
{unlockKeyId, appCode?} |
200 {challenge, expiresAt, pinRequiredBy?} |
POST /field/auth/unlock |
{unlockKeyId, appCode, assertion} |
FieldTokenResponse (amr ["hwk","uv"]) |
POST /field/auth/unlock-keys/revoke |
{unlockKeyId} |
204 |
POST /field/worker/photo |
{size?: "thumb" | "full", version?}, Authorization: DPoP <access> |
200 image/jpeg with an ETag, or 304 |
POST /field/worker/photo/set |
the image bytes as the body, Authorization: DPoP <access> |
200 {photoVersion} |
POST /field/worker/photo/remove |
no body, Authorization: DPoP <access> |
200 {photoVersion: null} |
{ "accessToken": "<JWT>", "tokenType": "DPoP", "expiresIn": 600, "refreshToken": "fwr_...", "refreshExpiresAt": "2026-11-08T22:00:00.000000Z", "idleExpiresAt": "2026-11-08T10:15:00.000000Z", "worker": { "id": "fwu_...", "workerCode": "W-1042", "name": "Sam", "photoVersion": null, "canSetOwnPhoto": false }, "pinChangeRequired": false, "unlockKeys": { "allowed": false, "attestationRequired": false }}refreshExpiresAt is the login’s absolute deadline. Every answer that carries a session (login, refresh,
unlock, act-as, sign-in code) has the same worker and unlockKeys members, computed for the session’s
application (an application override can change them).
worker.photoVersionis the version of the worker’s photo,nullwhen there is none or photos are off for the platform or the client.worker.canSetOwnPhotois true only when photos are on, the client’s policy hasworkerMaySetOwnPhoto, and the session is the worker’s own (not an act-as or sign-in code session).unlockKeysis advisory (a registration checks every rule again):allowedis true only when the application has unlock keys on, the session is on anACTIVEPERSONALenrolled device and is the worker’s own;attestationRequiredis true whenallowedand the policy requires a trusted Android attestation;registerExpiresIn(whole seconds) is present only when the session began with the worker’s PIN on this device less than 10 minutes ago and no PIN change is pending.
The proof (every request)
Section titled “The proof (every request)”Every request carries a header DPoP: <JWS> proving possession of the device key.
| Part | Requirement |
|---|---|
| JOSE header | typ: dpop+jwt, alg: ES256 (only), jwk = the device’s public EC P-256 key. A private member is refused. |
htm |
The HTTP method. |
htu |
The platform’s configured public base URL plus the request path. Never the Host header, no query. |
iat |
Required. Accepted within plus or minus 24 hours (devices have bad clocks). |
jti |
Required. |
nonce |
Required on every route except /field/auth/nonce. |
ath |
Required on bearer routes: base64url SHA-256 of the access token. |
The key’s thumbprint jkt is RFC 7638: SHA-256 of {"crv","kty","x","y"} (lexicographic, no
whitespace), base64url without padding. A bad proof is 401 invalid_dpop_proof with
WWW-Authenticate: DPoP error="invalid_dpop_proof", algs="ES256".
Nonces
Section titled “Nonces”A nonce is 32 random bytes, base64url, valid 5 minutes and single use (consumed atomically).
Because a nonce cannot be replayed the platform keeps no jti cache. Every response, success or
error, carries a fresh DPoP-Nonce header. A missing, used or expired nonce is 401 use_dpop_nonce
with WWW-Authenticate: DPoP error="use_dpop_nonce" and the fresh nonce; the client retries once.
POST /field/auth/nonce returns the same value in its body.
Devices and unenrolled keys
Section titled “Devices and unenrolled keys”Enrolment is opt-in. The proof is required on every route, and a key that is not an enrolled device’s
key is an unenrolled request. It may sign in, refresh and change the PIN, and its tokens stay
bound to the key (cnf.jkt).
- With the client’s policy
requireEnrolledDevice, an unknown key gets401 UNKNOWN_DEVICE(login, PIN change, act-as, sign-in code, and refresh of an unenrolled session). - An enrolled key that is
SUSPENDEDorREVOKEDis403 DEVICE_SUSPENDEDor403 DEVICE_REVOKEDand never falls back to unenrolled. - An unenrolled key cannot use badge-only sign-in, unlock keys, device revoke and suspend, the
per-device failure budget,
device-alllogout, or a device’s app restriction.
The enrolment code is 10 characters from 23456789ABCDEFGHJKMNPQRSTUVWXYZ, valid 10 minutes, single
use, shown once by an administrator. Its QR payload is fcfield:1:<platform base URL>:<code>. The
code is consumed atomically with the device insert; a failure leaves it unused.
| Error | Meaning |
|---|---|
401 INVALID_ENROLMENT_CODE |
Unknown, used or expired. |
409 DEVICE_KEY_EXISTS |
The key is already enrolled. |
422 ATTESTATION_REQUIRED |
The client’s policy requires attestation, which the platform cannot yet verify. |
403 CLIENT_INACTIVE |
|
400 INVALID_PUBLIC_KEY |
attestationChain is stored raw; the level is recorded as reported-but-unverified SOFTWARE or NONE.
Send exactly one of workerCode or badgeToken (else 400 INVALID_REQUEST). The client is resolved
first:
- an enrolled device’s client (a
clientIdentifiernaming another is400 CLIENT_MISMATCH); - a badge’s client (a non-matching
clientIdentifieris401 INVALID_CREDENTIALS); - for an unenrolled key with a
workerCode,clientIdentifieris required, and an unknown or inactive client is401 INVALID_CREDENTIALSafter a dummy PIN verify (no client enumeration).
Then, in order: requireEnrolledDevice; the device is ACTIVE; the subject and client failure buckets
(429 TOO_MANY_ATTEMPTS with Retry-After); the worker exists and is ACTIVE with a PIN (else a dummy
verify and 401 INVALID_CREDENTIALS); hard lock (423 WORKER_LOCKED); soft lock
(429 WORKER_LOCKED_TEMPORARILY with Retry-After); PIN verify. A wrong PIN is 401 INVALID_CREDENTIALS.
A PIN under a removed key. PIN hashes are peppered with a key derived from FLOWCATALYST_APP_KEY. If a worker’s stored hash was made under a key that is no longer configured (neither the current key nor any in FLOWCATALYST_APP_KEY_PREVIOUS), the PIN cannot be checked at all and the answer is 403 PIN_RESET_REQUIRED (“this PIN was set under a retired key and must be reset by a supervisor”). It is not a wrong guess: no failure is recorded, the lockout counters and budgets are not fed, and retrying cannot help. A supervisor resetting the PIN fixes it. The same answer comes from PIN change (for the current PIN) and from act-as (for the supervisor’s own PIN). See Rotating the app key.
Badge. The token (FWB1 plus 26 Crockford Base32 characters) is upper-cased and hashed. Unknown or
revoked is 401 INVALID_CREDENTIALS. With a badge the pin is also required (400 PIN_REQUIRED)
unless the client’s policy has badgeOnlyLogin and the device is enrolled. amr is
["badge","pin"] or ["badge"].
Only after the PIN or badge verifies are the authorisation checks made: the worker holds a grant for
the application, the application is active, the device (when enrolled) is enrolled for it, a
PERSONAL device assigned to a worker is that worker’s, and the client is ACTIVE. Any failure is
403 NO_APP_ACCESS; the reason is in the sign-in log, never in the response. Success resets the
failure counter and rehashes a legacy PIN hash.
Locks and budgets. The soft-lock threshold-th consecutive failure soft-locks for the policy’s
softLockSecs; each further failure re-arms it; the hard-lock threshold-th hard-locks until an
administrator unlocks or resets. Failure buckets, per hour: device FC_FIELD_DEVICE_FAILURES_PER_HOUR
(20), per IP FC_FIELD_IP_FAILURES_PER_HOUR (100, used for an unenrolled key), client
FC_FIELD_CLIENT_FAILURES_PER_HOUR (300). Each emits one throttle event per window. Policy values
and defaults are in the admin API.
Sessions and refresh
Section titled “Sessions and refresh”A login is a family; each refresh token is one row. The refresh token is 32 random bytes,
base64url, prefixed fwr_; only its SHA-256 is stored.
POST /field/auth/refresh rotates: the presented token is revoked ROTATED and a child with the
same family, amr and absolute deadline is issued with a new idle deadline.
| Limit | Value |
|---|---|
| Idle | Policy personalIdleSecs (PERSONAL), sharedIdleSecs (SHARED) or unenrolledIdleSecs (unenrolled). |
| Absolute | Policy shiftMaxSecs (PERSONAL) or 43 200 s (SHARED and unenrolled). |
Past either, 401 SESSION_EXPIRED. The worker, the grant and (enrolled sessions) the device are
re-checked on every refresh. A session is bound to the proof key (jkt) it was created with; presenting
the refresh token with any other key (or device) is theft and revokes the family.
Reuse. A ROTATED token presented again with a valid proof from the session’s own key within
60 seconds of its rotation is treated as a lost response: the family’s live child is rotated and a
fresh one issued. Any other presentation of a rotated token (later, or from another device) revokes the
whole family (REUSE), emits a session-revoked event and answers 401 INVALID_GRANT. An unknown,
logged-out or revoked token is 401 INVALID_GRANT.
Logout. scope: "session" ends the token’s family; device-all ends every session on the proof’s
device (a shared-device hand-over; needs an enrolled device, else 400 INVALID_REQUEST). It is
idempotent; a token not signed in with this proof key is a quiet 204.
PIN change
Section titled “PIN change”POST /field/auth/pin takes Authorization: DPoP <access token> and the proof (with ath). A token
marked pcr (PIN change required) is accepted here and nowhere else. The current PIN goes through the
same lockout accounting as a login (a PIN stored under a removed key is 403 PIN_RESET_REQUIRED, with no lockout accounting). The new PIN must pass the client’s policy (422 PIN_POLICY with
details.violations[]) and differ from the current one. The worker’s other families are revoked
(PIN_CHANGED); the current one is kept, and the client refreshes to drop pcr. It works from an
unenrolled key; an impersonated session gets 403 IMPERSONATING.
PINs are digits only, at most 12, and may not be all one digit, a straight run (including wrap-around:
123456, 890123, 654321), on the short common list, or the worker’s own code.
Unlock keys
Section titled “Unlock keys”An unlock key is a P-256 key pair made in the phone’s secure hardware that signs only after a strong
biometric match. The platform stores the public half and verifies signatures with it, so a worker whose
session has ended signs in again without the PIN. The client’s policy (or the application’s override) must
have unlockKeysEnabled, which is off by default. The device must be an enrolled, ACTIVE, PERSONAL one.
Every route is POST, behind the usual proof and single-use nonce. The rules and the console side are in
Field-worker identity.
Signatures. All are compact JWS, ES256 only (raw 64-byte r || s, canonical base64url), and each names
itself in typ and aud so the platform refuses one kind presented as another: the DPoP proof
(dpop+jwt, signed by the device key); the key proof (typ: fc-unlock-key+jwt, aud
<platform base URL>/field/auth/unlock-keys, claims nonce = the nonce of the registration request’s own
DPoP proof, sub = the worker id, device_id, iat); and the unlock assertion
(typ: fc-unlock+jwt, header kid = the key id, aud <platform base URL>/field/auth/unlock, claims
nonce = the challenge, sub, device_id, app = the application code, iat). The two unlock-key JWS
are signed by the unlock key, never the device key; the header holds exactly typ and alg (and kid),
with no jwk, x5c or crit. Any failure is 401 INVALID_UNLOCK_PROOF.
Register (/field/auth/unlock-keys, bearer). publicKeyJwk is {kty: "EC", crv: "P-256", x, y} and not
the device key. attestationChain is optional, an array of standard base64 DER certificates, leaf first (at
most 10, each at most 16 KiB; Android only). The access token must be this device’s, not a pcr token, not
impersonated, from a PIN sign-in (amr ["pin"] or ["badge","pin"]) at most 10 minutes old. One live key
per device: the same worker registering again replaces their key (REPLACED), another worker is refused.
Challenge (/field/auth/unlock/challenge, no bearer). appCode is optional now and becomes required at
the next major version of the protocol; a library sends it so the worker is never shown a biometric prompt for
an application that does not accept the key. The answer’s challenge is single use, valid 5 minutes, good only
for that key on that device. pinRequiredBy is present when the policy forces a periodic PIN
(pinReauthDays 1 to 90; the default 0 forces none).
Unlock (/field/auth/unlock, no bearer). The answer is the ordinary FieldTokenResponse with amr
["hwk","uv"], the device’s PERSONAL limits (capped at the key’s PIN deadline when there is one), and never
a pcr or act. The worker, the grant, the application, the device and the client are checked as for a PIN
login (any failure is 403 NO_APP_ACCESS). A forged or replayed assertion counts as a wrong PIN against the
worker’s lock and the device and client budgets; a successful unlock does not reset the PIN’s failure
counter or soft lock. The challenge route is limited per device (FC_FIELD_UNLOCK_CHALLENGES_PER_HOUR,
default 30).
Revoke (/field/auth/unlock-keys/revoke, no bearer). Any holder of the device key may revoke a key on
that device; a key of another device, an unknown one or a revoked one answers 204 and changes nothing. It
does not end the session the worker is in.
| Code | Status | Routes |
|---|---|---|
UNLOCK_KEYS_DISABLED |
403 | register, challenge, unlock |
SHARED_DEVICE |
403 | register, challenge, unlock |
PIN_SIGN_IN_REQUIRED |
403 | register: not from a recent PIN sign-in on this device, or a PIN change is pending |
WORKER_UNAVAILABLE |
403 | register |
UNLOCK_KEY_OTHER_WORKER, UNLOCK_KEY_EXISTS |
409 | register |
INVALID_UNLOCK_PROOF |
401 | register, unlock |
UNLOCK_KEY_INVALID |
401 | challenge, unlock: unknown, revoked, or not this device’s |
CHALLENGE_EXPIRED |
401 | unlock (not counted as a failure) |
PIN_REAUTH_REQUIRED |
401 | challenge, unlock: the periodic PIN is due or a PIN change is pending; the key is kept |
ATTESTATION_REQUIRED |
422 | register |
ATTESTATION_STATUS_UNAVAILABLE |
503 | register, challenge, unlock (Retry-After; the key is not revoked) |
PIN_RESET_REQUIRED |
403 | challenge, unlock |
The platform revokes keys when a supervisor resets the PIN, when the worker is suspended, hard-locked or
deleted, when the device is revoked, when the worker changes the PIN on another device, when the policy
switches unlock keys off (unless an application override keeps them on) or starts requiring attestation, and
when an administrator revokes one. A revoked key and the sessions it signed in end together, so the next
refresh of such a session is 401 INVALID_GRANT.
The worker’s own photo
Section titled “The worker’s own photo”The three /field/worker/photo* routes act only on the token’s own worker (the request names nobody) and
need the proof and the bearer token. A pcr token is 401 invalid_token. They are limited per worker per
hour (FC_FIELD_PHOTO_READS_PER_HOUR 120, FC_FIELD_PHOTO_WRITES_PER_HOUR 20) besides the per-IP governor
(429, with Retry-After), and need the client’s enrolled-device rule satisfied (401 UNKNOWN_DEVICE).
- Read.
sizeisthumb(128 px, the default) orfull(512 px), else400 INVALID_REQUEST. The answer isimage/jpegwithETag: "<version>-<size>"; send theversionthe device holds and it is304while current. A worker with no photo, or a client with photos off, is404 PHOTO_NOT_FOUND. A supervisor acting as the worker may read. - Set. The body is the image itself (up to the platform’s photo limit, 10 MiB by default, instead of the
protocol’s usual 64 KiB cap) with its
Content-Type, which may only agree with the bytes. JPEG, PNG and WebP are accepted, and the platform re-encodes them. Only when the client’s policy hasworkerMaySetOwnPhoto(403 OWN_PHOTO_NOT_ALLOWEDotherwise) andphotosEnabled(409 PHOTOS_DISABLED_FOR_CLIENT); an impersonated session is403 IMPERSONATING. The image refusals are400 PHOTO_EMPTY,413 PHOTO_TOO_LARGE,415 PHOTO_UNSUPPORTED_TYPE,400 PHOTO_TYPE_MISMATCH,400 PHOTO_DIMENSIONS_TOO_LARGE,400 PHOTO_UNREADABLEand503 PHOTO_BUSY(withRetry-After). - Remove. The same rule as set; removing a missing photo is not an error.
- With the feature off for the whole platform (
FC_FIELD_PHOTOS=off) every route is404 PHOTOS_DISABLED.
Browsers and CORS
Section titled “Browsers and CORS”/field/* answers cross-origin requests from a web page only for origins on the platform’s CORS Origins
list: POST with the Authorization, Content-Type and DPoP request headers, exposing DPoP-Nonce,
Retry-After, WWW-Authenticate and ETag, never * and never credentials. An origin not on the list gets
no CORS headers and its preflight is 403. A request with no Origin (a phone’s native app) is unaffected.
See field-js.
Impersonation
Section titled “Impersonation”Both paths below produce a session for the worker (sub, worker_code, name and the client
claims are the worker’s), with an act claim for whoever is acting and amr ending "imp". pcr is
never set. The absolute limit is the least of the normal limit, the policy’s impersonationMaxSecs and,
for act-as, the supervisor’s own session expiry. Refresh re-checks that the actor may still act.
- Act-as (
POST /field/auth/act-as, bearer = the supervisor’s own token):403 IMPERSONATINGif that session is itself impersonated; the supervisor must be ACTIVE,canImpersonateand not locked (403 IMPERSONATION_FORBIDDEN).pinis the supervisor’s PIN, verified with full lockout accounting. The target must be in the same client, ACTIVE (a locked target is allowed), not a supervisor, not the supervisor, and granted the token’s application (else403 NO_APP_ACCESS).amris["pin","imp"]. - Sign-in code (
POST /field/auth/sign-in-code): a console administrator issuesFWS1plus 26 characters, valid 10 minutes, single use. Redeeming consumes it atomically (401 INVALID_CODE: unknown, used, expired or its creator no longer active) and re-checks the worker, grant, application, client,requireEnrolledDeviceand the device’s app restriction.actis{sub: <principal id>, typ: "principal", name};amris["code","imp"].
Both emit an impersonation event and an audit row whose principal is the actor and whose entity is the worker.
Errors in one place
Section titled “Errors in one place”| Code | Status |
|---|---|
use_dpop_nonce, invalid_dpop_proof, invalid_token (bearer routes) |
401 |
UNKNOWN_DEVICE, INVALID_CREDENTIALS, INVALID_CODE, INVALID_GRANT, SESSION_EXPIRED, INVALID_ENROLMENT_CODE, INVALID_UNLOCK_PROOF, UNLOCK_KEY_INVALID, CHALLENGE_EXPIRED, PIN_REAUTH_REQUIRED |
401 |
PHOTOS_DISABLED, PHOTO_NOT_FOUND |
404 |
PHOTO_TOO_LARGE |
413 |
PHOTO_UNSUPPORTED_TYPE |
415 |
DEVICE_SUSPENDED, DEVICE_REVOKED, IMPERSONATING, IMPERSONATION_FORBIDDEN, NO_APP_ACCESS, CLIENT_INACTIVE, PIN_RESET_REQUIRED, SHARED_DEVICE, UNLOCK_KEYS_DISABLED, PIN_SIGN_IN_REQUIRED, WORKER_UNAVAILABLE, OWN_PHOTO_NOT_ALLOWED |
403 |
CLIENT_MISMATCH, PIN_REQUIRED, INVALID_REQUEST, INVALID_PUBLIC_KEY, PHOTO_EMPTY, PHOTO_TYPE_MISMATCH, PHOTO_DIMENSIONS_TOO_LARGE, PHOTO_UNREADABLE |
400 |
DEVICE_KEY_EXISTS, LINK_EXISTS (admin link), UNLOCK_KEY_OTHER_WORKER, UNLOCK_KEY_EXISTS, PHOTOS_DISABLED_FOR_CLIENT |
409 |
PIN_POLICY, ATTESTATION_REQUIRED, INVALID_LINK (admin link) |
422 |
WORKER_LOCKED |
423 |
WORKER_LOCKED_TEMPORARILY, TOO_MANY_ATTEMPTS |
429 |
FIELD_IDENTITY_UNCONFIGURED, ATTESTATION_STATUS_UNAVAILABLE, PHOTO_BUSY |
503 |
Sign-in attempts (success and failure, with device, method and reason) are recorded in
field_login_attempts, retained 90 days by default (FC_FIELD_LOGIN_ATTEMPT_RETENTION_DAYS; 0 keeps
them forever).
Verifying a field token in your backend
Section titled “Verifying a field token in your backend”The access token is a JWT signed with the platform key (same kid and JWKS as every platform token),
typ: fc-field+jwt, RS256 only, lifetime FC_FIELD_ACCESS_TOKEN_TTL_SECS (default 600). It is never a
platform API credential. Your application verifies it with the SDK’s field verifier, or asks the
platform (POST /api/field-tokens/introspect, which answers {"active": false} for anything that
fails a check, including a pcr token).
The verifier checks the token: typ, signature, iss, exp (required: a token without it is
invalid_token), token_use, aud (your application code), refusal of pcr; and the proof:
cnf.jkt, htm, htu, ath, and iat within plus or minus 5 minutes. htu is compared with the
application’s configured public base URL plus the request path; the Host and X-Forwarded-*
headers are never used. Nonce checking at the application is out of the SDK’s scope. Shared test
vectors are in api/field-fixtures/ (cases.json and jwks.json); see
Conformance vectors.
WebView bridge protocol (version 1)
Section titled “WebView bridge protocol (version 1)”When a field web app runs in a WebView inside a React Native app, the page (field-js) cannot hold a
hardware-backed key or the secure store itself. The host app provides them over a small message
bridge. This is the contract between field-js and field-react-native.
Shared interfaces.
type AttestationLevel = "STRONGBOX" | "TEE" | "SOFTWARE" | "NONE";interface PublicEcJwk { kty: "EC"; crv: "P-256"; x: string; y: string }interface DeviceKey { jwk: PublicEcJwk; attestation: { level: AttestationLevel; chain?: string[] } }
interface KeyProvider { getOrCreateDeviceKey(): Promise<DeviceKey>; sign(data: Uint8Array): Promise<Uint8Array>; // ES256 over SHA-256(data): raw r||s, 64 bytes deleteDeviceKey(): Promise<void>;}interface SecureStore { get(key: string, opts?: { prompt?: string }): Promise<string | null>; set(key: string, value: string, opts?: { requireBiometric?: boolean }): Promise<void>; delete(key: string): Promise<void>; biometricAvailable(): Promise<boolean>;}set never prompts the user; only get of a biometric entry prompts. Errors carry a code:
KEY_INVALIDATED, BIOMETRIC_UNAVAILABLE, BIOMETRIC_CANCELLED, NO_SECURE_LOCK_SCREEN, INTERNAL.
Transport. The page posts to the host with window.ReactNativeWebView.postMessage(string). The host
answers by calling window.__fcFieldBridge.receive(string) through injectJavaScript. The host
installs, before content loads:
window.__fcFieldBridge = { version: 1, receive: function (m) { if (this._l) this._l(m); else (this._q = this._q || []).push(m);} };The page never replaces receive. On first use it sets window.__fcFieldBridge._l = handler, drains
_q, and handles each entry. Bridge availability is
typeof window.__fcFieldBridge === "object" && window.__fcFieldBridge.version === 1 && typeof window.ReactNativeWebView?.postMessage === "function".
Request (page to host) and response (host to page), each a JSON string:
{"fcField": 1, "id": "<unique per request>", "op": "key.sign", "args": {"data": "<base64url>"}}{"fcField": 1, "id": "<same id>", "ok": true, "result": {"signature": "<base64url>"}}{"fcField": 1, "id": "<same id>", "ok": false, "error": {"code": "KEY_INVALIDATED", "message": "..."}}op |
args |
result |
|---|---|---|
key.getOrCreate |
{} |
DeviceKey |
key.sign |
{data: <base64url>} |
`{signature: <base64url of 64 bytes r |
key.delete |
{} |
{} |
store.get |
{key, prompt?} |
{value: string | null} |
store.set |
{key, value, requireBiometric?} |
{} |
store.delete |
{key} |
{} |
bio.available |
{} |
{available: boolean} |
Rules: the host answers only pages whose origin is in its allowedOrigins (any other origin gets no
answer and a warning without the payload). Messages without fcField: 1 are ignored, so the app’s own
messages pass through. An unknown op is {ok:false, error:{code:"INTERNAL"}}. Responses whose id is
unknown are ignored. The page times out a request after 60 seconds (a biometric prompt can be slow).
Store values cross the bridge as strings; the host never logs value or data.