Python Client for Twilio Authy Two-Factor Authentication (2FA) API
Documentation for Python usage of the Authy API lives in the official Twilio documentation.
The Authy API supports multiple channels of 2FA:
- One-time passwords via SMS and voice.
- Soft token (TOTP via the Authy App)
- Push authentication via the Authy App
If you only need SMS and Voice support for one-time passwords, we recommend using the Twilio Verify API instead.
For a full tutorial, check out either of the Python Authy Quickstarts in our docs:
Authy Python Installation
Install with pip:
$ pip install authy
Download the source code and run the following command from your terminal:
$ python setup.py install
Note that you may need admin permissions to run the above commands.
To use the Authy client, import AuthyApiClient and initialize it with your production API Key found in the Twilio Console:
from authy.api import AuthyApiClient authy_api = AuthyApiClient('your_api_key')
Notice: Twilio Authy API’s Sandbox feature will stop working on Sep 30, 2021
Twilio is discontinuing the Authy API’s Sandbox, a feature that allows customers to run continuous integration tests against a mock Authy API for free. The Sandbox is no longer being maintained, so we will be taking the final deprecation step of shutting it down on September 30, 2021. The rest of the Authy API product will continue working as-is.
This repo previously used the sandbox API as part of the test suite, but that has been since removed.
You will only be affected if you are using the sandbox API in your own application or test suite.
For more information please read this article on how we are discontinuing the Twilio Authy sandbox API.
Install development dependencies with pip:
sudo pip install -r requirements.txt
To run tests:
make testfile tests/<test_case_file>
Copyright (c) 2011-2020 Authy Inc. See LICENSE for further details.