1.0.11 • Published 2 years ago

node-tfa v1.0.11

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

node-tfa

Installation

npm i node-tfa

Usage

Hotp

import Secret, { hotpGenerate, hotpVerify } from 'node-tfa';

const secret = new Secret({ label: 'USER_NAME', issuer: 'APP_NAME' })

const token = hotpGenerate({ secret: c.base32, counter: 1 })

hotpVerify({ secret: secret.base32, counter: 1, token })

Totp

import Secret, { totpGenerate, totpVerify } from 'node-tfa';

const secret = new Secret({ label: 'USER_NAME', issuer: 'APP_NAME' })

const token = totpGenerate({ secret: secret.base32 })

totpVerify({ secret: secret.base32, token })

Google Authenticator

import Secret, { totpVerify } from 'node-tfa';

const secret = new Secret({ label: 'USER_NAME', issuer: 'APP_NAME', qr_code: true, type: 'totp' })

secret.qr_code

totpVerify({ secret: secret.base32, token: 'TOKEN_FROM_GOOGLE_AUTHENTICATOR' })
1.0.11

2 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.10

3 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago