Socket
Socket
Sign inDemoInstall

google_authenticator

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    google_authenticator

GoogleAuthenticator


Version published
Weekly downloads
123
decreased by-22.64%
Maintainers
1
Install size
8.20 kB
Created
Weekly downloads
 

Readme

Source

nodejs-GoogleAuthenticator

nodejs-GoogleAuthenticator-logo

Installation

npm i google_authenticator --save

Usage

var googleAuth=require('google_authenticator').authenticator;
var nya=new googleAuth();

API

Class: googleAuth([codeLength=6])

The main class.

  • codeLength:optional,the length of the verifiction code,defaults to 6.

googleAuth.createSecret([secretLength=16])

To create a random secret string.

return the secret string.

  • secretLength:optional,the length of the secret string,defaults to 16。

googleAuth.getCode(secret[,timeSlice])

get the code

return a string of code consists by numbers.

  • secret:the secret string.
  • timeSlice:optional,specifies the time slice.

googleAuth.verifyCode(secret,code[,discrepancy=1,currentTimeSlice])

verify the code.

if verified,return true,otherwise return false.

  • secret:the secret string.
  • code:the verifiction code.
  • discrepancy:the allowed time discrepancy.
  • currentTimeSlice:you know.

googleAuth.getQRCodeText(name,secret[,title])

get the QR code raw text

  • name:the name to display in the GoogleAuthenticator client.
  • secret:the secret string.
  • title:optional,I can't find if this is displayed anywhere.....

googleAuth.getGoogleQRCodeAPIUrl(name,secret[,title])

get the QR code image using google api.

return the url of the QR image.

Keywords

FAQs

Last updated on 22 Aug 2021

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