https://github.com/bandwidth/node-mfa
https://github.com/bandwidth/node-mfa
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bandwidth/node-mfa
- Owner: Bandwidth
- License: other
- Created: 2020-05-29T18:22:20.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-02-12T21:16:34.000Z (4 months ago)
- Last Synced: 2025-02-12T22:26:14.300Z (4 months ago)
- Language: TypeScript
- Size: 1.89 MB
- Stars: 1
- Watchers: 8
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# $${\color{orange}This \space package \space has \space been \space deprecated}$$
# Please use the new [node-sdk](https://github.com/Bandwidth/node-sdk)
## The new package is on NPM as [bandwidth-sdk](https://www.npmjs.com/package/bandwidth-sdk) (`npm i bandwidth-sdk`)# Bandwidth Node Multi-Factor Authentication SDK
Note: As of version 3.0.0, this package has been upgraded to TypeScript
[](https://github.com/Bandwidth/node-mfa/actions/workflows/test.yml)
| **OS** | **Node** |
|:---:|:---:|
| Windows 2016 | 12, 14, 16 |
| Windows 2019 | 12, 14, 16 |
| Ubuntu 20.04 | 12, 14, 16 |
| Ubuntu 22.04 | 12, 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 = 3var 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