Duo Web SDK for two-factor authentication
Project description
Duo Universal Python SDK
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 Promptdemo
- An example web application with Duo integratedtests
- 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!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for duo_universal-2.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58a4a1f0f369118810d81043cd25d1707a9ceb3dc3d0517cedb6dec12cc327bb |
|
MD5 | 37b2b8d71063e5ddbd0804cbd8583da9 |
|
BLAKE2b-256 | 486f50d5a47f0f933b8bbe58c5917ff0886ce35abbdc892611bb776a2fc45dac |