UNPKG

gigya-node

Version:
36 lines (30 loc) 1.74 kB
import { CoreOptions } from 'request'; import Gigya from './gigya'; import { RegisterParams } from './interfaces/tfa'; export * from './interfaces/gigya-response'; export * from './interfaces/base-params'; export * from './interfaces/tfa'; export class TFATotp { constructor(protected gigya: Gigya) {} /** * It creates a Gigya assertion that contains some information about the user, the site, and the mode (whether registration or verify). * It creates a secret that is expressed to the user as a QR code, used by the user for pairing their authenticating app, and a secret token, * that is part of the actual authentication * * @see https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/413c65da70b21014bbc5a10ce4041860.html */ public totpRegister(params: RegisterParams & any, options?: CoreOptions | undefined) { return this.gigya.request<any>('accounts.tfa.totp.register', params, options); } /** * This method is part of a two-factor authentication (TFA) flow and is triggered after the user submits the code generated by the authenticating app * (after accounts.tfa.totp.register). It verifies the code against the secret saved to this user's account, * and is followed by accounts.tfa.finalizeTFA. Note that TFA is part of Risk Based Authentication (RBA). * * @see https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/413cb1cd70b21014bbc5a10ce4041860.html */ public totpVerify(params: RegisterParams & any, options?: CoreOptions | undefined) { return this.gigya.request<any>('accounts.tfa.totp.verify', params, options); } } export default TFATotp;