Skip to content

SudoSOS Back-end API / authentication / NfcAuthenticator

Class: NfcAuthenticator ​

The NFC Authenticator is used for Near Field Communication (NFC) card-based authentication. This authentication method allows users to authenticate using physical NFC cards or tags by simply tapping them against an NFC reader.

NFC Authentication is a direct authentication method. Unlike hash-based methods, the NFC code (UID) is stored directly in the database and compared against the scanned value. This provides fast authentication suitable for point-of-sale scenarios.

NFC Authentication Flow ​

  1. User taps their NFC card against an NFC reader.
  2. Reader captures the NFC UID and sends it to /authentication/nfc.
  3. Authentication Controller looks up the NfcAuthenticator by the provided UID.
  4. Authentication Controller retrieves the associated user.
  5. Authentication Controller returns a JWT token if the NFC code is valid.

Security Considerations ​

  • NFC codes are stored in plain text (not hashed) for fast lookup
  • NFC authentication can return a "lesser" JWT token (when posId is provided) to limit access scope. A token is considered "lesser" if it has a posId property set.
  • Physical possession of the NFC card is required for authentication

Extends ​

Constructors ​

Constructor ​

ts
new NfcAuthenticator(): NfcAuthenticator;

Returns ​

NfcAuthenticator

Inherited from ​

AuthenticationMethod.constructor

Properties ​

PropertyModifierTypeDescriptionInherited from
createdAtreadonlyDateThe creation date of the object.AuthenticationMethod.createdAt
nfcCodepublicstring--
updatedAtreadonlyDateThe last update date of the object.AuthenticationMethod.updatedAt
userpublicUser-AuthenticationMethod.user
userIdpublicnumber-AuthenticationMethod.userId
versionreadonlynumberThe current version of the object.AuthenticationMethod.version