UNPKG

@digitalpersona/authentication

Version:
28 lines 1.22 kB
import { Credential } from '@digitalpersona/core'; import { Authenticator } from '../../private'; /** * Personal Identification Number (PIN) authentication API. * PIN support only authentication. Identification is not supported. */ export class PinAuth extends Authenticator { /** Constructs a new PIN authentication API object. * @param authService - an {@link AuthService|authentication service client} connected to the server. */ constructor(authService) { super(authService); } /** Authenticates the user using user's PIN code. * @param identity - a {@link User |username} or a JSON Web Token. * @param pin - a user's PIN. * @returns a promise to return a JSON Web Token containing a claim (`crd`) showing the fact * a PIN was used. * Will reject if authentication fails. * @remarks * If the `identity` parameter is a user name, a new token will be created. * If the `identity` parameter is a JSON Web Token, an updated token will be returned. */ authenticate(identity, pin) { return super._authenticate(identity, new Credential(Credential.PIN, pin)); } } //# sourceMappingURL=auth.js.map