Socket
Socket
Sign inDemoInstall

@bandwidth/mfa

Package Overview
Dependencies
15
Maintainers
8
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bandwidth/mfa

Bandwidth's Two-Factor Authentication service


Version published
Weekly downloads
65
increased by8.33%
Maintainers
8
Install size
4.49 MB
Created
Weekly downloads
 

Readme

Source

Bandwidth Node Multi-Factor Authentication SDK

Note: As of version 3.0.0, this package has been upgraded to TypeScript

Test

OSNode
Windows 201612, 14, 16
Windows 201912, 14, 16
Ubuntu 20.0412, 14, 16
Ubuntu 22.0412, 14, 16

Getting Started

Installation

npm install @bandwidth/mfa

Initialize

import { Client, MFAController } from '@bandwidth/mfa';

const client = new Client({
    basicAuthUserName: "username",
    basicAuthPassword: "password"
});

const controller = new MFAController(client);
const accountId = "12345";

Create A MFA Request

var from = "+15554443333";
var to = "+15553334444";
var applicationId = "3-a-b-c";
var scope = "scope";
var digits = 6;
var message = "Your temporary {NAME} {SCOPE} code is {CODE}";

var requestBody = {
    from: from,
    to: to,
    applicationId: applicationId,
    scope: scope,
    digits: digits,
    message: message
};

await controller.voiceTwoFactor(accountId, requestBody);

//request verification
const code = '123456'; //this is the user input to validate
const expirationTimeInMinutes = 3

var verifyBody = {
    to: to,
    applicationId: applicationId,
    scope: scope,
    code: code,
    expirationTimeInMinutes: expirationTimeInMinutes
}

var verifyMfaResponse = await controller.verifyTwoFactor(accountId, verifyBody);

console.log(verifyMfaResponse.result.valid);

Supported Node Versions

This package can be used with Node >= 10

Documentation

Documentation for this package can be found at https://dev.bandwidth.com/sdks/node.html

Credentials

Information for credentials for this package can be found at https://dev.bandwidth.com/guides/accountCredentials.html

FAQs

Last updated on 19 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc