Skip to content

SudoSOS Back-end API / authentication / PinAuthenticator

Class: PinAuthenticator ​

PIN Authentication can return a lesser JWT token (when posId is provided) and should only be used for authenticating at a point of sale. The reason for returning a lesser JWT token is to prevent brute-force attacks, since PINs are 4-digit numbers and could easily be guessed. A token is considered "lesser" if it has a posId property set.

PIN Authentication is a hash-based authentication method. This means that the PIN code is hashed and stored in the database, and later compared against the input of the user.

Extends ​

Constructors ​

Constructor ​

ts
new PinAuthenticator(): PinAuthenticator;

Returns ​

PinAuthenticator

Inherited from ​

HashBasedAuthenticationMethod.constructor

Properties ​

PropertyModifierTypeDefault valueDescriptionInherited from
createdAtreadonlyDateundefinedThe creation date of the object.HashBasedAuthenticationMethod.createdAt
hashpublicstringundefined-HashBasedAuthenticationMethod.hash
updatedAtreadonlyDateundefinedThe last update date of the object.HashBasedAuthenticationMethod.updatedAt
userpublicUserundefined-HashBasedAuthenticationMethod.user
userIdpublicnumberundefined-HashBasedAuthenticationMethod.userId
versionreadonlynumberundefinedThe current version of the object.HashBasedAuthenticationMethod.version
IS_PIN_AUTHENTICATORreadonlytruetrueStatic property to identify PIN authenticators for type checking.-