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 ​
- User taps their NFC card against an NFC reader.
- Reader captures the NFC UID and sends it to
/authentication/nfc. - Authentication Controller looks up the NfcAuthenticator by the provided UID.
- Authentication Controller retrieves the associated user.
- 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 ​
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
createdAt | readonly | Date | The creation date of the object. | AuthenticationMethod.createdAt |
nfcCode | public | string | - | - |
updatedAt | readonly | Date | The last update date of the object. | AuthenticationMethod.updatedAt |
user | public | User | - | AuthenticationMethod.user |
userId | public | number | - | AuthenticationMethod.userId |
version | readonly | number | The current version of the object. | AuthenticationMethod.version |