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/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duo_universal-2.3.1.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duo_universal-2.3.1-py2.py3-none-any.whl (21.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file duo_universal-2.3.1.tar.gz.

File metadata

  • Download URL: duo_universal-2.3.1.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for duo_universal-2.3.1.tar.gz
Algorithm Hash digest
SHA256 2474d20e86a67632f2976e962cf417794e37e8982c28dfb7ccb94f1303d602b5
MD5 22004ca055c006b2ed5aac1504b959eb
BLAKE2b-256 36687efd09ee3c9b07e37510dd60149e112b408e1a63d90749c15f95cbac512a

See more details on using hashes here.

File details

Details for the file duo_universal-2.3.1-py2.py3-none-any.whl.

File metadata

  • Download URL: duo_universal-2.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for duo_universal-2.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 872db644b3fbea0c6935f64a267e523bed33910b5298e5992fc389729e49eb3f
MD5 1d8daf26740c3f9c23e953bfd1b08beb
BLAKE2b-256 89429e8ed250cc7b085f6f9e25e1db28c46e05fd8f2db0f1c7a28757ea17e20e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.3.1 This release

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

1.1.0

2 files

1.0.1

1 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