Skip to main content

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 Python web login form. Both Python 2 and Python 3 are 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).

pip 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:

# Python 3
python -m venv env
source env/bin/activate

# Python 2
virtualenv env
source env/bin/activate

Build and install the SDK from source:

pip install -r requirements.txt
pip install .

Tests

Install the test requirements:

cd tests
pip install -r requirements.txt

Then run tests from the test directory:

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

# Run all tests with nose
nose2

# Run all tests with unittest
python -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/

Metadata

Release files for duo-universal 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for duo-universal 1.1.0
File Size Uploaded
duo_universal-1.1.0.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for duo-universal 1.1.0
File Interpreter ABI Platform
duo_universal-1.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 30.4 kB

Release files / duo_universal-1.1.0.tar.gz

Download URL duo_universal-1.1.0.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a1d145038c32b944032f60fc51a679afe3b8f0816fd31e3ad37944ec952c6f3b
BLAKE2b-256 checksum
How to use checksums
13c948592662839bda12b1b3e27056cc604f861e50100a72df15c2770a2ed7f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.0 importlib_metadata/3.7.3 packaging/20.9 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / duo_universal-1.1.0-py2.py3-none-any.whl

Download URL duo_universal-1.1.0-py2.py3-none-any.whl
Size 14.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
04b95cebdc31230b3ca24f53391f72ba5c92a501beb1c228f6c7075bce0a353f
BLAKE2b-256 checksum
How to use checksums
bb4e555245a409c74d94320b4eaa029abfd99f4718fa6e82f91918da46713170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.0 importlib_metadata/3.7.3 packaging/20.9 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release history Release notifications | RSS feed

2.3.1

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

This release

1.1.0 This release

2 release files

1.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page