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 ​
| Property | Modifier | Type | Default value | Description | Inherited from |
|---|---|---|---|---|---|
createdAt | readonly | Date | undefined | The creation date of the object. | HashBasedAuthenticationMethod.createdAt |
hash | public | string | undefined | - | HashBasedAuthenticationMethod.hash |
updatedAt | readonly | Date | undefined | The last update date of the object. | HashBasedAuthenticationMethod.updatedAt |
user | public | User | undefined | - | HashBasedAuthenticationMethod.user |
userId | public | number | undefined | - | HashBasedAuthenticationMethod.userId |
version | readonly | number | undefined | The current version of the object. | HashBasedAuthenticationMethod.version |
IS_PIN_AUTHENTICATOR | readonly | true | true | Static property to identify PIN authenticators for type checking. | - |