Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.
/ duo_web_sdk Public archive

Duo Web JavaScript in ES6 Module for easy install

License

Notifications You must be signed in to change notification settings

duosecurity/duo_web_sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecation Notice

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


Overview

Build Status Issues Forks Stars License

duo_web_sdk - Provides the Duo Web Javascript in an ES6 module format that can be installed via npm/yarn and bundled into your web application.

Installation

Install duo_web_sdk from Github:

  • With NPM: npm install https://github.com/duosecurity/duo_web_sdk.git --save
  • With yarn: yarn add https://github.com/duosecurity/duo_web_sdk.git
  • For development: npm install

Usage

Basic usage would be importing this module and initializing the Duo Authentication Prompt with the signed request passed from the server. The user would authenticate using the prompt, and you would submit the signed response to your backend for verification.

import DuoWebSDK from 'duo_web_sdk';

DuoWebSDK.init({
  iframe: "duo-frame",
  host: host,
  sig_request: sigRequestPassedFromServer,
  submit_callback: someCallback,
});

See the examples folder for a full implementation using React and Express.

Testing

$ npm test

Documentation

General documentation on using Duo Web is available here.