Faces¶
IDEN can use a person's face as a second factor: after their password, never instead of it. It
is off by default — IDEN_BIOMETRIC_ENABLED turns it on, and the
biometric engine has to be running.
One to one, never one to many¶
Every comparison IDEN makes is 1:1: this capture against the face enrolled on the account that just signed in with a password. IDEN never searches everyone enrolled to find out who a face is.
An identity provider only ever asks are you who you claim to be? A search would answer a question nobody here asks, and at a price: its false-match rate grows with every person enrolled, its templates have to sit unencrypted where an index can read them, and it is the kind of biometric processing regulators treat most strictly.
Enrolling happens at a kiosk¶
A face is enrolled at a kiosk, never from a browser. A kiosk has a fixed camera in known light, which makes better templates, and it is a place the person has to be in.
sequenceDiagram
participant P as Person
participant D as Dashboard
participant I as IDEN
participant K as Kiosk
P->>D: sign in, Security → Enrol at a kiosk
D->>I: POST /entity/face/ticket (recent sign-in)
I-->>D: ticket → shown as a QR code
P->>K: reads what enrolling involves, agrees
P->>K: shows the QR code
K->>I: POST /biometric/enroll/challenge (kiosk token + ticket)
I-->>K: "Enrolling Jane D." + what to capture
K->>I: POST /biometric/enroll (frames + consent version)
I-->>K: enrolled
The kiosk signs in as itself, with client_credentials and the biometric:enroll scope. That
credential names nobody. The ticket is what says whose face this is, and only the person can
create one — after signing in to the dashboard within the last five minutes. So a stolen kiosk
secret, on its own, enrols no one.
A ticket:
- names one person, and lasts 15 minutes (
IDEN_FACE_TICKET_TTL) - allows five capture attempts (
IDEN_FACE_ENROL_ATTEMPTS) — poor light should not end the visit, but a ticket is not a way to try forever - is gone once a face is enrolled with it, and asking for a new one retires the old one
Consent¶
Before the camera turns on, the kiosk shows what enrolling involves — the photos and the liveness steps, that the kiosk keeps nothing, the encrypted template, what the face is used for and who never sees it, what replacing a face and removing one mean — and asks the person to agree. No, thanks ends the visit with nothing captured.
The words come from IDEN (biometric/consent.py), not the kiosk, because they describe what this
deployment does: with IDEN_BIOMETRIC_KEEP_IMAGES=true they say the photos are kept. Their version
is a hash of the words, so changing either the wording or that setting is a new version. The kiosk
sends the version the person agreed to with the capture; IDEN refuses anything but the current one
(consent_required) and stores the version and the time with the face, in
face_templates.consent_version and consented_at. Faces enrolled before consent was asked for have
neither.
A version is only a hash, so the words behind it are kept too: the first enrolment under a version
saves its title and statements in consent_wordings. Changing the text needs no other step — the next
heartbeat hands kiosks the new version, and a person still looking at the old one is asked again.
Faces keep the version they agreed to; nobody has to re-enrol.
Kiosks are registered devices¶
Every kiosk is registered in the dashboard and has a client of its own. A new device is paired: an administrator registers the kiosk and is shown a short code, and the device trades it, once, for its own secret. So:
- one kiosk can be cut off without touching the others. Revoking it deletes its client, and enrolment refuses a token whose client is not a registered kiosk, so it stops at once — even while its last access token has minutes to run;
- a kiosk can be taken out of service from the dashboard, and IDEN refuses its enrolments until it is put back;
- every enrolment names the kiosk — on the person's security page and in the kiosk's own history in the dashboard, with why each failed attempt failed.
Setting one up is in Kiosks.
Enrolling again replaces the face on file. The kiosk's last screen tells the person where to remove it, and the audit log records the kiosk and whose face it was. IDEN sends no email, so nobody is told about an enrolment anywhere else — see Open issues.
Signing in¶
Face is offered after the password, in two situations:
| Situation | What the person sees |
|---|---|
An application asks for acr_values=urn:iden:acr:mfa-face |
The face step. Nothing else reaches that level. |
| They have an authenticator app, which makes a second factor owed at every sign-in | A choice: their face or a code. Either one answers it. |
An enrolled face does not on its own make a second factor owed. Someone at a laptop without a camera must still be able to sign in, and an authenticator app is the factor that carries that rule — see Assurance and step-up.
A successful face step adds face to amr; with the password that is urn:iden:acr:mfa-face.
What "live" means¶
A face that matches is not enough. A photograph of the person matches too. Every capture has to pass the checks below, and each stops something different:
| Check | How | Stops |
|---|---|---|
| Anti-spoofing model | InsightFace's liveness model judges each straight-ahead frame | Printed photos, phone and screen replays |
| Actions — enrolment only | Two of turn left, turn right, look up, look down, blink, smile, drawn at random for this attempt, measured from facial landmarks against the person's own face looking ahead | A still photo; a recording made before the attempt began |
| Consistency | Every frame must show the same person | Swapping faces partway through |
The actions are asked for at the kiosk, once, when the face is enrolled. Sign-in asks for none: a few frames looking straight at the camera, judged by the anti-spoofing model, because turning your head at every sign-in is a chore people would avoid the face step over. What a face proves at sign-in therefore rests on the anti-spoofing model alone.
Either way, what to capture is a challenge: issued by IDEN, good for one capture, two minutes, and one person. A capture made for one attempt is useless for the next.
The kiosk waits for each action rather than timing it. A face tracker running in the page (MediaPipe's face landmarker, built into the kiosk image, with no picture leaving the page for it) follows the head, the eyes and the mouth. Each action is announced two seconds ahead, starts with a tone, and ends with a chime once its frames are taken — the person cannot read the screen with their head turned. An action waits up to eight seconds — for a turn of about 25°, a tilt of about 20°, the eyes open, closed and open again, or a smile held — and lasts at least five, so nobody is hurried into the next. The tracker only decides when the frames are taken: the engine judges every one of them itself, so a modified page gains nothing. A straight-ahead frame caught mid-blink is left out of the anti-spoofing check and never kept as a template.
When a capture is not good enough to judge — too dark, too far away, blurred, two faces — nothing is
decided. The person is told what to fix, and it does not count as a failed attempt. A capture that is
judged and fails is refused without saying which check failed, and three of those in fifteen minutes
lock face sign-in for that account until fifteen minutes after the first. A successful face sign-in
starts the count again. IDEN_FACE_LOGIN_ATTEMPTS and IDEN_FACE_LOGIN_WINDOW change the three and
the fifteen minutes.
What it does not stop¶
Be clear about this before relying on it:
- A video stream injected into the browser. A virtual camera fed by a real-time deepfake is the attack that matters for faces on the web, and sign-in, which asks for no movements, does nothing to make it harder. No check that runs on IDEN's side can prove a frame came from a real camera.
- A screen the anti-spoofing model does not recognise. Nothing else looks for a replay held up to the camera. IDEN does not flash the screen to test for one, because flashing colours can harm people with photosensitive epilepsy.
- Identical twins, and to a lesser degree close relatives.
- Anything a certification would have found. These checks are not tested by an accredited lab against ISO/IEC 30107-3 (presentation attacks) or CEN/TS 18099 (injection attacks). A deployment that needs that assurance replaces the anti-spoofing model with a certified product.
This is why a face is a second factor here and never the only one.
What is stored¶
| Where | Protected by | |
|---|---|---|
| Embeddings — a few vectors per person, no image | face_templates in PostgreSQL |
Encrypted with the same key as TOTP secrets, and bound to the account: a row copied onto another person does not decrypt |
| Enrolment photos | Blob storage, only with IDEN_BIOMETRIC_KEEP_IMAGES=true |
Encrypted the same way |
| Captures made at sign-in | Nowhere | The engine sees them for the length of one request |
Removing a face — from the dashboard by the person, or by an administrator — deletes the embeddings and any photos together.
Why keep photos at all? Embeddings from one model cannot be compared under another. Upgrade the
model and every face on file stops matching; without photos, everyone enrols again. With them,
scripts.reembed_faces moves the faces to the new model and nobody has to come back.
The models¶
The engine runs open models by default, pinned by checksum in engine/models.toml:
| Job | Model | Licence |
|---|---|---|
| Detection | SCRFD-10G (InsightFace buffalo_l) | Non-commercial research only |
| Recognition | ArcFace R50, WebFace600K (InsightFace buffalo_l) | Non-commercial research only |
| Anti-spoofing | InsightFace liveness | Non-commercial research only |
None of these licences permits commercial use. A deployment that is not research replaces them
with weights it is licensed to use — a commercial SDK, or a model trained on data it has
the rights to. That is a change to models.toml, not to code.
The match threshold in models.toml is a conservative starting point, not calibrated: until it
is, the engine says calibrated: false. Calibrating means measuring on your own cameras and your
own people — see the engine guide.