This repository is deprecated by Duo Security. The repository will remain public and visible, and integrations built using this repository’s code will continue to work. You can also continue to fork, clone, or pull from this repository.
However, Duo will not provide any further releases or enhancements.
Duo recommends migrating your application to the Duo Universal Prompt. Refer to our documentation for more information on how to update.
For frequently asked questions about the impact of this deprecation, please see the Repository Deprecation FAQ
duo_nodejs - Duo two-factor authentication for Node.js web applications: https://duo.com/docs/duoweb-v2
This package allows a web developer to quickly add Duo's interactive, self-service, two-factor authentication to any web login form - without setting up secondary user accounts, directory synchronization, servers, or hardware.
Files located in the js
directory should be hosted by your webserver for inclusion in web pages.
Development:
$ git clone https://github.com/duosecurity/duo_nodejs.git
$ cd duo_nodejs
$ npm install
System:
$ npm install --global @duosecurity/duo_web
Or run the following to add to your project:
$ npm install --save @duosecurity/duo_web
$ node --interactive
> const duo_web = require('@duosecurity/duo_web');
> duo_web.sign_request(ikey, skey, akey, username);
'TX|...TX_SIGNATURE...==|...TX_HASH...:APP|...APP_SIGNATURE...==|...APP_HASH...'
$ npm run test
...
OK: 13 assertions (42ms)
$ npm run lint
> @duosecurity/[email protected] lint duo_nodejs
> eslint duo.js index.js tests/
Report any bugs, feature requests, etc. to us directly: [email protected]