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 Python3 web login form. Only Python 3 is supported.

Tested Against Python Versions:

  • 3.7
  • 3.8
  • 3.9
  • 3.10
  • 3.11

TLS 1.2 and 1.3 Support

Duo_universal_python uses Python's ssl module and OpenSSL for TLS operations. Python versions 2.7 (and higher) and 3.5 (and higher) have both TLS 1.2 and TLS 1.3 support.

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/

Metadata

Release files for duo-universal 2.1.1

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 2.1.1
File Size Uploaded
duo_universal-2.1.1.tar.gz 24.9 kB Details

Built distribution (wheel)

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

Total release size: 40.3 kB

Release files / duo_universal-2.1.1.tar.gz

Download URL duo_universal-2.1.1.tar.gz
Size 24.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6c02508b835695cfb700526e6d77648cc4622618f514afbb8d114c275abf65cb
BLAKE2b-256 checksum
How to use checksums
beed487b4d55739cfd31aa6c1c850edee8067e6eb8974a6233b8c071f2f1513b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

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

Download URL duo_universal-2.1.1-py2.py3-none-any.whl
Size 15.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e97ded01ff54d881534102dbb461ac7cc20b1c3f98eac3dd8612b0a1db5675b4
BLAKE2b-256 checksum
How to use checksums
3c045b63bec296dd81d476bc0f1796d9e6bbe6300a806627f09a9bcd20e5139d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release history Release notifications | RSS feed

2.3.1

2 release files

2.2.0

2 release files

This release

2.1.1 This release

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

1.1.0

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