=============================================
|KLEIDES| Kleides Multi Factor Authentication
=============================================
.. 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:
* Static devices included in django-otp.
* TOTP devices included in django-otp.
* Yubikey devices using `django-otp-yubikey`_.
* U2F devices using `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.
* Free software: GNU General Public License v3
* Documentation: https://kleides-mfa.readthedocs.io.
Install
-------
.. 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')),
]
Extending Kleides MFA
---------------------
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:
* Register the django-otp model with the registration and verification
form in the apps ready.
* Device registration should be contained in the `create_form_class`.
* Device verification should be contained in the `verify_form_class`.
.. |KLEIDES| image:: assets/kleides-icon.png
:alt: Kleides
=======
History
=======
0.2.1 (2024-03-15)
------------------
* Fix device_id url component converter
* Update test project for warnings
0.2.0 (2024-02-20)
------------------
* Deprecate KLEIDES_MFA_PATCH_ADMIN for custom AdminConfig app
* Add decorators and mixins for recent authentication checks
* Refactor app settings to enable override_settings
* Include jquery qrcode javascript
* Run ValidationService migration on routed database
0.1.17 (2022-05-17)
-------------------
* Add signals to act on adding/removing MFA devices.
* Fix compatibility with Django-4.0.
* Update test matrix for supported releases only.
* Make device table responsive.
0.1.16 (2021-09-10)
-------------------
* Update bootstrap, jquery and popper script tags.
0.1.15 (2021-07-13)
-------------------
* Prevent single factor access to device list when multi factor is
available.
* Switch to setuptools_scm for automatic git versioning.
* Move package data to setup.cfg.
* Add Python 3.9 and Django 3.2 to the support matrix.
* Remove Python 3.5 and Django 3.0 which are end of life.
* Move test dependencies to the kleides-mfa[test] extra.
* Switch to PEP517 package builder.
0.1.14 (2020-10-22)
-------------------
* Configure ValidationService on the database that is being migrated.
0.1.13 (2020-09-29)
-------------------
* Send user_login_failed signal on device failures.
* Test Django login signals with Kleides MFA.
0.1.12 (2020-09-23)
-------------------
* Add python 3.8 and Django 3.1 to support matrix.
* Test unprintable token input.
* Remove future statements.
* Remove non-optional PATCH_USER setting.
0.1.11 (2020-06-11)
-------------------
* Fix unset plugin attribute on PermissionDeniedError.
0.1.10 (2020-06-09)
-------------------
* Restart authentication when accessing a bad device.
0.1.9 (2020-04-15)
------------------
* Replace deprecated Django-3.0 functions.
* Fix session cleanup after login as different user.
0.1.8 (2019-12-10)
------------------
* Escape the next parameter in the "Other method" device selection.
* Show device name in verification form.
0.1.7 (2019-11-18)
------------------
* Actually remove django-crispy-forms as a hard dependency.
* Add function to get the authentication method of a logged in user.
0.1.6 (2019-11-14)
------------------
* Preserve next parameter when redirecting to verification url.
0.1.5 (2019-11-14)
------------------
* Use cloudflare for all external script/style.
* Remove crispy forms as a hard dependency.
0.1.4 (2019-11-12)
------------------
* Add setting to disable patching of the User models.
* Patch AnonymousUser to share the properties of the User model.
* Add configurable redirect for users that login without 2 step
authentication.
* Fix 2 step test login when another user was logged in.
0.1.3 (2019-11-07)
------------------
* Cleanup plugin button/table alignment.
* Add Yubikey plugin for `django-otp-yubikey`_.
* Only patch AdminSite when admin is installed.
* Remove python 2 compatibility classifiers.
.. _django-otp-yubikey: https://github.com/django-otp/django-otp-yubikey
0.1.2 (2019-11-06)
------------------
* Improve and fix documentation.
0.1.1 (2019-11-04)
------------------
* Set defaul device name if omitted from POST data.
0.1.0 (2019-11-04)
------------------
* First release on PyPI.
Raw data
{
"_id": null,
"home_page": "https://github.com/ossobv/kleides-mfa",
"name": "kleides-mfa",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "kleides django-otp two factor authentication 2fa",
"author": "Harm Geerts",
"author_email": "hgeerts@osso.nl",
"download_url": "https://files.pythonhosted.org/packages/89/5d/5bb4ebad58565aa46fbf18426b22dac2e9f4191c285c1b8360abcf74ea07/kleides-mfa-0.2.1.tar.gz",
"platform": null,
"description": "=============================================\n|KLEIDES| Kleides Multi Factor Authentication\n=============================================\n\n.. image:: https://img.shields.io/pypi/v/kleides_mfa.svg\n :target: https://pypi.python.org/pypi/kleides_mfa\n\n.. image:: https://travis-ci.org/ossobv/kleides-mfa.svg\n :target: https://travis-ci.org/ossobv/kleides-mfa\n :alt: Continuous Integration Status\n\n.. image:: https://readthedocs.org/projects/kleides-mfa/badge/?version=latest\n :target: https://kleides-mfa.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\nKleides MFA provides a convenient interface to configure, manage and\nauthenticate with multi factor authentication for `django-otp`_ plugins.\nCurrently supported plugins are:\n\n* Static devices included in django-otp.\n* TOTP devices included in django-otp.\n* Yubikey devices using `django-otp-yubikey`_.\n* U2F devices using `django-otp-u2f`_.\n\n.. _django-otp: https://github.com/django-otp/django-otp\n.. _django-otp-yubikey: https://github.com/django-otp/django-otp-yubikey\n.. _django-otp-u2f: https://github.com/ossobv/django-otp-u2f\n\n.. image:: assets/interface-w-bg.png\n :alt: Overview of Kleides MFA authentication method interface.\n\n* Free software: GNU General Public License v3\n* Documentation: https://kleides-mfa.readthedocs.io.\n\n\nInstall\n-------\n\n.. code-block::\n\n pip install kleides-mfa\n\nAdd `kleides_mfa` to your `INSTALLED_APPS` with your preferred\ndjango-otp plugins::\n\n INSTALLED_APPS = [\n ...\n 'django_otp',\n 'django_otp.plugins.otp_static',\n 'django_otp.plugins.otp_totp',\n 'kleides_mfa',\n ...\n ]\n\nAdd `kleides_mfa.middleware.KleidesAuthenticationMiddleware` to the\n`MIDDLEWARE` setting after the Django AuthenticationMiddleware::\n\n MIDDLEWARE = [\n ...\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'kleides_mfa.middleware.KleidesAuthenticationMiddleware',\n ...\n ]\n\nDo not use `django_otp.middleware.OTPMiddleware` with Kleides MFA as it\nwill not be able to load the OTP device.\n\nSet the LOGIN_URL::\n\n LOGIN_URL = 'kleides_mfa:login'\n\nInclude `kleides_mfa.urls` in your urlpatterns::\n\n urlpatterns = [\n path('', include('kleides_mfa.urls')),\n ]\n\n\nExtending Kleides MFA\n---------------------\n\nYou can add or replace authentication methods using the\n`kleides_mfa.registry.KleidesMfaPluginRegistry`. Documentation\nis currently lacking but you can check the implementation of currently\nsupported django-otp plugins to get a basic idea.\n\nIn short for devices using django-otp:\n\n* Register the django-otp model with the registration and verification\n form in the apps ready.\n* Device registration should be contained in the `create_form_class`.\n* Device verification should be contained in the `verify_form_class`.\n\n\n.. |KLEIDES| image:: assets/kleides-icon.png\n :alt: Kleides\n\n=======\nHistory\n=======\n\n0.2.1 (2024-03-15)\n------------------\n\n* Fix device_id url component converter\n* Update test project for warnings\n\n\n\n0.2.0 (2024-02-20)\n------------------\n\n* Deprecate KLEIDES_MFA_PATCH_ADMIN for custom AdminConfig app\n* Add decorators and mixins for recent authentication checks\n* Refactor app settings to enable override_settings\n* Include jquery qrcode javascript\n* Run ValidationService migration on routed database\n\n\n0.1.17 (2022-05-17)\n-------------------\n\n* Add signals to act on adding/removing MFA devices.\n* Fix compatibility with Django-4.0.\n* Update test matrix for supported releases only.\n* Make device table responsive.\n\n\n0.1.16 (2021-09-10)\n-------------------\n\n* Update bootstrap, jquery and popper script tags.\n\n\n0.1.15 (2021-07-13)\n-------------------\n\n* Prevent single factor access to device list when multi factor is\n available.\n* Switch to setuptools_scm for automatic git versioning.\n* Move package data to setup.cfg.\n* Add Python 3.9 and Django 3.2 to the support matrix.\n* Remove Python 3.5 and Django 3.0 which are end of life.\n* Move test dependencies to the kleides-mfa[test] extra.\n* Switch to PEP517 package builder.\n\n\n0.1.14 (2020-10-22)\n-------------------\n\n* Configure ValidationService on the database that is being migrated.\n\n\n0.1.13 (2020-09-29)\n-------------------\n\n* Send user_login_failed signal on device failures.\n* Test Django login signals with Kleides MFA.\n\n\n0.1.12 (2020-09-23)\n-------------------\n\n* Add python 3.8 and Django 3.1 to support matrix.\n* Test unprintable token input.\n* Remove future statements.\n* Remove non-optional PATCH_USER setting.\n\n\n0.1.11 (2020-06-11)\n-------------------\n\n* Fix unset plugin attribute on PermissionDeniedError.\n\n\n0.1.10 (2020-06-09)\n-------------------\n\n* Restart authentication when accessing a bad device.\n\n\n0.1.9 (2020-04-15)\n------------------\n\n* Replace deprecated Django-3.0 functions.\n* Fix session cleanup after login as different user.\n\n\n0.1.8 (2019-12-10)\n------------------\n\n* Escape the next parameter in the \"Other method\" device selection.\n* Show device name in verification form.\n\n\n0.1.7 (2019-11-18)\n------------------\n\n* Actually remove django-crispy-forms as a hard dependency.\n* Add function to get the authentication method of a logged in user.\n\n\n0.1.6 (2019-11-14)\n------------------\n\n* Preserve next parameter when redirecting to verification url.\n\n\n0.1.5 (2019-11-14)\n------------------\n\n* Use cloudflare for all external script/style.\n* Remove crispy forms as a hard dependency.\n\n\n0.1.4 (2019-11-12)\n------------------\n\n* Add setting to disable patching of the User models.\n* Patch AnonymousUser to share the properties of the User model.\n* Add configurable redirect for users that login without 2 step\n authentication.\n* Fix 2 step test login when another user was logged in.\n\n\n0.1.3 (2019-11-07)\n------------------\n\n* Cleanup plugin button/table alignment.\n* Add Yubikey plugin for `django-otp-yubikey`_.\n* Only patch AdminSite when admin is installed.\n* Remove python 2 compatibility classifiers.\n\n.. _django-otp-yubikey: https://github.com/django-otp/django-otp-yubikey\n\n\n0.1.2 (2019-11-06)\n------------------\n\n* Improve and fix documentation.\n\n\n0.1.1 (2019-11-04)\n------------------\n\n* Set defaul device name if omitted from POST data.\n\n\n0.1.0 (2019-11-04)\n------------------\n\n* First release on PyPI.\n",
"bugtrack_url": null,
"license": "GNU General Public License v3",
"summary": "Interface components to configure and manage multi factor authentication",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://github.com/ossobv/kleides-mfa"
},
"split_keywords": [
"kleides",
"django-otp",
"two",
"factor",
"authentication",
"2fa"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "21ff31f541aff8c7223ef18fb020108032d48cc40199ba1f1e90118ec4208fcd",
"md5": "99ece268887602b08e7ce88587b55c62",
"sha256": "1672ba87b77f7137d7c2643c56dffeec9e501c85cb559abe017537846a91cc98"
},
"downloads": -1,
"filename": "kleides_mfa-0.2.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "99ece268887602b08e7ce88587b55c62",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6",
"size": 34201,
"upload_time": "2024-03-15T14:46:27",
"upload_time_iso_8601": "2024-03-15T14:46:27.797726Z",
"url": "https://files.pythonhosted.org/packages/21/ff/31f541aff8c7223ef18fb020108032d48cc40199ba1f1e90118ec4208fcd/kleides_mfa-0.2.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "895d5bb4ebad58565aa46fbf18426b22dac2e9f4191c285c1b8360abcf74ea07",
"md5": "fd6d89228e1f347ab675f539ba54c45c",
"sha256": "e4d62d0bc9f5d0d2452b23b875bd1b9ce40dedd9d993638798a7a47ebf62c627"
},
"downloads": -1,
"filename": "kleides-mfa-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "fd6d89228e1f347ab675f539ba54c45c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 214290,
"upload_time": "2024-03-15T14:46:30",
"upload_time_iso_8601": "2024-03-15T14:46:30.403271Z",
"url": "https://files.pythonhosted.org/packages/89/5d/5bb4ebad58565aa46fbf18426b22dac2e9f4191c285c1b8360abcf74ea07/kleides-mfa-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-15 14:46:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ossobv",
"github_project": "kleides-mfa",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"requirements": [],
"tox": true,
"lcname": "kleides-mfa"
}