Skip to content

Duo OIDC-based two-factor authentication for Python web applications

License

Notifications You must be signed in to change notification settings

duosecurity/duo_universal_python

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cdb0991 · Jul 8, 2022

History

45 Commits
Apr 15, 2022
Jul 8, 2022
Jul 8, 2022
Mar 25, 2021
Oct 29, 2020
Sep 16, 2020
Sep 16, 2020
Jul 8, 2022
Mar 25, 2021
Apr 28, 2022
Mar 24, 2021
Sep 16, 2020
Jul 8, 2022

Repository files navigation

Duo Universal Python SDK

Build Status Issues Forks Stars License

This SDK allows a web developer to quickly add Duo's interactive, self-service, two-factor authentication to any Python3 web login form. Only Python 3 is supported.

What's here:

  • duo_universal - The Python Duo SDK for interacting with the Duo Universal Prompt
  • demo - An example web application with Duo integrated
  • tests - Test cases

Getting Started

To use the SDK in your existing development environment, install it from pypi (https://pypi.org/project/duo_universal).

pip3 install duo_universal

Once it's installed, see our developer documentation at https://duo.com/docs/duoweb and demo/app.py in this repo for guidance on integrating Duo 2FA into your web application.

Contribute

To contribute, fork this repo and make a pull request with your changes when they're ready.

If you're not already working from a dedicated development environment, it's recommended a virtual environment is used. Assuming a virtual environment named env, create and activate the environment:

python3 -m venv env
source env/bin/activate

Build and install the SDK from source:

pip3 install -r requirements.txt
pip3 install .

Tests

Install the test requirements:

cd tests
pip3 install -r requirements.txt

Then run tests from the test directory:

# Run an individual test file
python3 <test_name>.py

# Run all tests with unittest
python3 -m unittest

Lint

flake8

Support

Please report any bugs, feature requests, or issues to us directly at support@duosecurity.com.

Thank you for using Duo!

https://duo.com/