django-trench provides a set of REST API endpoints to supplement django-rest-framework with multi-factor authentication (MFA, 2FA). It supports both standard built-in authentication methods, as well as JWT (JSON Web Token). django-trench follows the url pattern developed in djoser library and may act as its supplement.
We deliver a couple of sample secondary authentication methods including sending OTP based code by email, SMS/text as well as through 3rd party mobile apps or utilising YubiKey. Developers can easily add own auth backend supporting any communication channel.
- Install the package using pip:
pip install django-trench
or add it to your requirements file.
trenchlibrary to INSTALLED_APPS in your app settings file:
INSTALLED_APPS = ( ..., 'rest_framework', 'rest_framework.authtoken', # In case of implementing Token Based Authentication ..., 'trench', )
- Run migrations
Read further in: installation.
Trench uses Transifex service to translate our package into other languages.
We will appreciate your help with translation.