Terminal sign-in methods (face, QR, NFC and terminal QR)

Terminal sign-in methods

Some jurisdictions do not allow facial recognition for time and attendance. The Terminal therefore supports five ways for a worker to identify themselves. Each device can use any mix of them.

Method Who shows what Needs the Clock app Works on
Face recognition The worker looks at the kiosk camera No iPad, Android
Worker QR code The worker holds their Clock app ID badge up to the kiosk camera Yes iPad, Android
External QR code The worker holds a client or printed badge with a fixed QR code up to the kiosk camera No iPad, Android
NFC badge The worker taps an NFC card on the device No Android Chrome only (iPad has no web NFC)
Terminal QR (reverse QR) The kiosk shows a QR code and the worker scans it with the Clock app Yes Any phone

PIN sign-in is still available on every device. When a camera is on, the camera tile itself is the Clock In / Out button: it glows (brand colour while idle, green once a face or badge identifies someone), and a tap clocks the identified worker in or opens the PIN picker. Help (?) and Not me sit on the tile's corners. Without a camera the classic Clock In / Out button is shown.

How the rotating codes work

Worker QR codes and terminal QR codes are not static images. Each one carries a short code that rotates, tied to a secret stored on the record called the Terminal Tag.

Terminal Tag fields

Field Object Purpose
b3s__Terminal_Tag__c Contact Secret behind the worker's rotating ID badge QR.
b3s__Terminal_Tag__c Site (b3s__Site__c) Secret behind the terminal QR shown at that site.
b3s__NFC_Tag_Id__c Contact Serial number of the worker's NFC badge.
b3s__External_QR_Tag__c Contact Fixed value of a client or printed QR badge (up to 255 characters). See External QR badges.
b3s__Selfie_Version_Id__c Contact ContentVersion Id of the worker's badge photo.

Terminal Tags are generated automatically on insert, and on any update that leaves the field blank. To rotate a secret, for example after a lost phone, clear the field and save. A new tag is stamped immediately and every existing QR code for that record stops working.

Treat Terminal Tags like PINs. Grant field access only to the permission sets that need it. The WFM Admin permission set includes read and edit access to all five fields.

Backfilling existing records

Records created before this release have no tag. Download backfill-terminal-tags.apex from the Version 11 release downloads and run it as anonymous Apex (Developer Console or sf apex run --file). It processes Sites first and then up to 3,000 Contacts per run, and prints how many records remain. Run it again until both counts are 0. The batch size is limited by the CPU cost of other Contact automation in the org. Lower it in the script header if a run hits the CPU limit.

External QR badges

Some clients already issue their own badges, or want a printed QR card instead of the Clock app. Put the exact text the QR code contains into the worker's External QR Tag (b3s__External_QR_Tag__c).

External QR badges use the same qrLogin switch as Clock app badges. Add externalQrTagFieldPath to the contact schedulable and include the field in the pool's selection clauses (see below).

Terminal configuration

The Terminal is configured in the b3s__Component_Configuration__mdt record with type Terminal. Keep exactly one record of this type per org: duplicate b3s__Type__c values cause an app configuration error. See Terminal app for the rest of its keys.

Top level keys

Key Type Default Meaning
autoScanInBackground boolean true Face recognition, on the main screen and in the sign-in dialog. Set to false where biometrics are not permitted: workers then sign in with a PIN, QR or NFC, and the camera never opens for face matching.
qrLogin boolean false Read worker QR badges with the kiosk camera.
nfcLogin boolean false Read NFC badges. Ignored on devices without web NFC.
reverseQr boolean false Show the terminal QR in the bottom right corner of the main screen.
reverseQrUrl string none Link encoded in the terminal QR. Point it at the 3B Portals page that hosts the Clock app (its install page). Required when reverseQr is on.
clockLoginQr boolean false Show the Open on my phone button in the top left of the Clock app window after a worker signs in. Needs reverseQrUrl. Enforced on the server. See Signing in on a phone from the Terminal.

These are defaults for every device. A manager can override them per device under Manager View > Settings > Sign-in methods. Overrides are stored on the device, and Reset settings returns the device to the configuration defaults.

A method that is switched on but missing its configuration (a field path or reverseQrUrl) is turned off when the Terminal starts. The Terminal then shows a warning that names the missing settings. It does not block the Terminal, so managers can still reach Settings.

Schedulable field paths

Schedulable Key Required when Example
contact terminalTagFieldPath qrLogin is on (rotating Clock app badges) b3s__Terminal_Tag__c
contact externalQrTagFieldPath qrLogin is on (external QR badges) b3s__External_QR_Tag__c
contact nfcTagFieldPath nfcLogin is on b3s__NFC_Tag_Id__c
site terminalTagFieldPath reverseQr is on b3s__Terminal_Tag__c

The Terminal reports a setup error at start-up if a method is switched on and its field path is missing. qrLogin needs at least one of terminalTagFieldPath and externalQrTagFieldPath.

Choosing which workers load

A worker can only sign in at the Terminal if they are in the contact pool. Because every Contact receives a Terminal Tag, do not filter the pool on the tag alone, as that would load every Contact in the org. The sample configuration loads two groups (each selectionClause entry is a separate query and results are combined):

"contact": {
    "objectType": "Contact",
    "selectionClause": [
        "(b3s__Biometrics_Enrolled__c = true OR b3s__Worker_Pin__c != '' OR b3s__NFC_Tag_Id__c != null OR b3s__External_QR_Tag__c != null)",
        "b3s__Terminal_Tag__c != null AND Id IN (SELECT b3s__Contact__c FROM b3s__Shift__c WHERE b3s__Work_Site__c = :contextId AND DAY_ONLY(b3s__Scheduled_Start_Time__c) >= YESTERDAY AND DAY_ONLY(b3s__Scheduled_Start_Time__c) <= TOMORROW)"
    ],
    "nameFieldPath": "Name",
    "emailFieldPath": "Email",
    "biometricKeyFieldName": "b3s__Biometric_Key__c",
    "pinFieldPath": "b3s__Worker_Pin__c",
    "terminalTagFieldPath": "b3s__Terminal_Tag__c",
    "nfcTagFieldPath": "b3s__NFC_Tag_Id__c",
    "externalQrTagFieldPath": "b3s__External_QR_Tag__c",
    "optionName": "Name"
}

Adjust the second clause to match how workers are attached to a site in your org, for example through a site assignment object.

Example: biometrics-free site

{
    "autoScanInBackground": false,
    "qrLogin": true,
    "nfcLogin": false,
    "reverseQr": true,
    "reverseQrUrl": "https://<your-site-domain>/workers/clock"
}

Behaviour on the Terminal

Clock app configuration

The Clock app is configured in the b3s__Component_Configuration__mdt record with type Clock In / Out Component. The new items appear in the + menu of the navigation bar and are hidden unless enabled.

Key Type Menu item Meaning
canShowIdBadge boolean My ID badge Shows the worker's ID badge with their rotating QR code.
canScanTerminalQr boolean Scan terminal QR Opens the phone camera to scan a terminal QR and clock in or out. Also enables links from the terminal QR (see below).
canEnrollBiometrics boolean Register face Lets the worker enrol or refresh their face for Terminal face recognition.

All three read their fields from a badge schedulable, which loads the signed-in worker's own Contact:

"badge": {
    "objectType": "Contact",
    "selectionClause": ["Id = :contactUserId"],
    "nameFieldPath": "Name",
    "workerIdFieldPath": "Id",
    "terminalTagFieldPath": "b3s__Terminal_Tag__c",
    "selfieFieldPath": "b3s__Selfie_Version_Id__c",
    "biometricKeyFieldName": "b3s__Biometric_Key__c",
    "biometricsEnrolledFieldName": "b3s__Biometrics_Enrolled__c"
}
Key Meaning
nameFieldPath Name printed on the badge.
workerIdFieldPath Value printed as Worker ID. Defaults to the Contact Id.
terminalTagFieldPath Secret for the rotating QR. If empty, the badge shows a "not ready yet" message.
selfieFieldPath Field that stores the ContentVersion Id of the badge photo.
biometricKeyFieldName, biometricsEnrolledFieldName Fields written by Register face.

ID badge

The badge is designed like a wallet card: a header band, the worker's photo, name, Worker ID and the rotating QR with its countdown bar. The QR refreshes itself when the bar runs out.

If there is no photo, the photo box offers Add photo. On a phone this lets the worker take a picture or choose one from their library. The image is resized to 480 pixels and saved on the worker's Contact as a file titled X3B_Candidate_Photo. The latest ContentVersion Id is written to selfieFieldPath. Change photo replaces it at any time: each new photo is saved as a new version of the same X3B_Candidate_Photo file, so a worker only ever has one photo file and its version history. To delete a worker's photos entirely (for example on a data erasure request), delete that file from the Contact's Files related list and clear b3s__Selfie_Version_Id__c.

Clocking in with the terminal QR

  1. The worker opens + > Scan terminal QR and points the phone at the kiosk.
  2. The Clock app checks the site and code with the server.
  3. The scan then does exactly what the Start or Finish button would do. If the worker has a shift in progress, it is ended. Otherwise the shift the Clock view shows is started, the same way as tapping Start.
  4. The usual flow follows: the timer, any startShift or endShift action form on the shift schedulable, and the shift status.

The scan verifies a current code from the kiosk, so it works without GPS and even when canClockInOut is false. Use that combination to make the terminal QR the only way to clock in or out.

The terminal QR is a normal web link (reverseQrUrl plus the site and code). When a worker without the Clock app scans it with their phone's own camera, the link opens the Clock app page, where they can sign in and install the app. When the link opens a signed-in Clock app within the code's lifetime and canScanTerminalQr is on, the app clocks the worker in or out straight away. It then removes the code from the address, so reloading the page does not repeat the action. If the code has expired, the worker scans again from the + menu.

On clock in, the scanned terminal's site becomes the shift's site (shiftSiteFieldPath, default b3s__Work_Site__c). An unscheduled shift is created at that site. A scheduled shift only takes the site when it has none, so a planned site is never overwritten.

On iPhone, links from the camera open in the browser rather than an installed home-screen app, so first-time workers land in the browser. Once installed, workers should use Scan terminal QR inside the app.

Signing in on a phone from the Terminal

With clockLoginQr on, a worker who has signed in at the Terminal sees Open on my phone in the top left of the Clock app window. Tapping it shows a QR code. The worker scans it with their phone's camera, and the Clock app opens on the phone already signed in as them, ready to install. Tap the QR code or the button again to hide it. It also disappears when the Clock app window closes.

The QR code opens reverseQrUrl signed in as the worker. The sign-in lasts as long as a Portals magic link (b3p__Portal_Magic_Link_Validity__c, 14 days by default).

Only switch this on for trusted, supervised terminals, and treat the QR code like a magic link. Contacts marked Disabled Portal User (b3p__Disabled_Portal_User__c) cannot sign in this way.

Server endpoint

The Clock app and the Terminal call b3s.TerminalService: verifySiteCode checks a terminal QR code, and createClockLoginKey signs the worker in for Signing in on a phone from the Terminal. See Apex API reference.

The site's Terminal Tag is read on the server only. Users only need to be able to see the Site record. Do not grant users access to b3s__Site__c.b3s__Terminal_Tag__c.

Face enrolment moved to the Clock app

Workers can enrol their face from the Clock app (Register face) as well as on the Terminal's Manager View and the standalone biometric enrolment page. All three use the same enrolment flow and write the same fields. A bar under the camera shows capture progress, and the camera is sized so the whole step fits on a phone screen.

Troubleshooting

Symptom Likely cause
"Invalid or expired code" for every scan Device clock is wrong. Turn on automatic date and time on both devices.
"QR sign-in is not set up on this terminal" or a warning about missing configuration The Contact schedulable has no terminalTagFieldPath. Check that the org has only one Terminal configuration record.
"Your QR code is not set up yet" The worker's Contact has no Terminal Tag. Run the backfill script or save the Contact.
"You are not registered at this site" The worker is not in the Terminal's contact pool. Check the selection clauses.
"This QR code is assigned to more than one worker" Two Contacts in the pool share the same b3s__External_QR_Tag__c. Clear it on the old Contact.
External QR badge shows "QR code not recognised" The value on the Contact does not match the badge exactly (check case), the worker is not in the contact pool, or externalQrTagFieldPath is missing.
"This badge is assigned to more than one worker" Two Contacts share the same b3s__NFC_Tag_Id__c. Clear it on the old Contact.
Badge says it is not ready The Contact has no Terminal Tag. Run the backfill script or save the Contact.
Terminal QR card does not appear reverseQr is off on the device, reverseQrUrl or the Site terminalTagFieldPath is missing (the start-up warning names it), or the site has no Terminal Tag.
NFC option missing in Settings The device or browser has no web NFC (all iPads, desktop browsers).