.. image:: https://img.shields.io/pypi/v/kleides_mfa.svg :target: https://pypi.python.org/pypi/kleides_mfa
.. image:: https://travis-ci.org/ossobv/kleides-mfa.svg :target: https://travis-ci.org/ossobv/kleides-mfa :alt: Continuous Integration Status
.. image:: https://readthedocs.org/projects/kleides-mfa/badge/?version=latest :target: https://kleides-mfa.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
Kleides MFA provides a convenient interface to configure, manage and
authenticate with multi factor authentication for django-otp
_ plugins.
Currently supported plugins are:
django-otp-yubikey
_.django-otp-u2f
_... _django-otp: https://github.com/django-otp/django-otp .. _django-otp-yubikey: https://github.com/django-otp/django-otp-yubikey .. _django-otp-u2f: https://github.com/ossobv/django-otp-u2f
.. image:: assets/interface-w-bg.png :alt: Overview of Kleides MFA authentication method interface.
.. code-block::
pip install kleides-mfa
Add kleides_mfa
to your INSTALLED_APPS
with your preferred
django-otp plugins::
INSTALLED_APPS = [ ... 'django_otp', 'django_otp.plugins.otp_static', 'django_otp.plugins.otp_totp', 'kleides_mfa', ... ]
Add kleides_mfa.middleware.KleidesAuthenticationMiddleware
to the
MIDDLEWARE
setting after the Django AuthenticationMiddleware::
MIDDLEWARE = [ ... 'django.contrib.auth.middleware.AuthenticationMiddleware', 'kleides_mfa.middleware.KleidesAuthenticationMiddleware', ... ]
Do not use django_otp.middleware.OTPMiddleware
with Kleides MFA as it
will not be able to load the OTP device.
Set the LOGIN_URL::
LOGIN_URL = 'kleides_mfa:login'
Include kleides_mfa.urls
in your urlpatterns::
urlpatterns = [ path('', include('kleides_mfa.urls')), ]
You can add or replace authentication methods using the
kleides_mfa.registry.KleidesMfaPluginRegistry
. Documentation
is currently lacking but you can check the implementation of currently
supported django-otp plugins to get a basic idea.
In short for devices using django-otp:
create_form_class
.verify_form_class
... |KLEIDES| image:: assets/kleides-icon.png :alt: Kleides