{"id":13531306,"url":"https://github.com/labd/wagtail-2fa","last_synced_at":"2025-04-05T19:09:59.904Z","repository":{"id":38107173,"uuid":"125503323","full_name":"labd/wagtail-2fa","owner":"labd","description":"2 Factor Authentication for Wagtail","archived":false,"fork":false,"pushed_at":"2024-08-19T12:06:00.000Z","size":282,"stargazers_count":87,"open_issues_count":27,"forks_count":45,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-29T18:05:53.334Z","etag":null,"topics":["2fa","django","python","wagtail"],"latest_commit_sha":null,"homepage":"https://wagtail-2fa.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/labd.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-16T10:47:56.000Z","updated_at":"2025-02-25T03:16:10.000Z","dependencies_parsed_at":"2023-02-18T04:46:05.760Z","dependency_job_id":"4f7da4e0-e86d-49b2-a888-8e8d53b01abc","html_url":"https://github.com/labd/wagtail-2fa","commit_stats":{"total_commits":230,"total_committers":31,"mean_commits":7.419354838709677,"dds":0.6869565217391305,"last_synced_commit":"ac54797cf3b7709bfb0aa740634de304343f6d37"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fwagtail-2fa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fwagtail-2fa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fwagtail-2fa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Fwagtail-2fa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labd","download_url":"https://codeload.github.com/labd/wagtail-2fa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386263,"owners_count":20930618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2fa","django","python","wagtail"],"created_at":"2024-08-01T07:01:01.893Z","updated_at":"2025-04-05T19:09:59.806Z","avatar_url":"https://github.com/labd.png","language":"Python","funding_links":[],"categories":["Apps"],"sub_categories":["Security"],"readme":".. start-no-pypi\n\n.. image:: https://github.com/labd/wagtail-2fa/workflows/Python%20Tests/badge.svg\n    :target: https://github.com/labd/wagtail-2fa/actions?query=workflow%3A%22Python+Tests%22\n\n.. image:: http://codecov.io/github/labd/wagtail-2fa/coverage.svg?branch=master\n    :target: http://codecov.io/github/labd/wagtail-2fa?branch=master\n\n.. image:: https://img.shields.io/pypi/v/wagtail-2fa.svg\n    :target: https://pypi.python.org/pypi/wagtail-2fa/\n\n.. image:: https://readthedocs.org/projects/wagtail-2fa/badge/?version=stable\n    :target: https://wagtail-2fa.readthedocs.io/en/stable/?badge=stable\n\n.. image:: https://img.shields.io/github/stars/labd/wagtail-2fa.svg?style=social\u0026logo=github\n    :target: https://github.com/labd/wagtail-2fa/stargazers\n\n.. end-no-pypi\n\n===========\nwagtail-2fa\n===========\n\nThis Django app adds two factor authentication to Wagtail. Behind the scenes\nit use django-otp_ which supports Time-based One-Time Passwords (TOTP). This\nallows you to use various apps like Authy, Google Authenticator, or\n1Password.\n\n\n.. _django-otp: https://django-otp-official.readthedocs.io\n\n\nInstallation\n============\n\n.. code-block:: shell\n\n   pip install wagtail-2fa\n\n\nThen add the following lines to the ``INSTALLED_APPS`` list in your Django\nsettings:\n\n.. code-block:: python\n\n    INSTALLED_APPS = [\n        # ...\n        'wagtail_2fa',\n        'django_otp',\n        'django_otp.plugins.otp_totp',\n        # ...\n    ]\n\nNext add the required middleware to the ``MIDDLEWARE``. It should come\nafter the AuthenticationMiddleware:\n\n.. code-block:: python\n\n    MIDDLEWARE = [\n        # .. other middleware\n        # 'django.contrib.auth.middleware.AuthenticationMiddleware',\n\n        'wagtail_2fa.middleware.VerifyUserMiddleware',\n\n        # 'wagtail.core.middleware.SiteMiddleware',\n        # .. other middleware\n    ]\n\nMigrate your database:\n\n.. code-block:: shell\n\n   python manage.py migrate\n\n\n\nSettings\n========\n\nThe following settings are available (Set via your Django settings):\n\n- ``WAGTAIL_2FA_REQUIRED`` (default ``False``): When set to True all\n  staff, superuser and other users with access to the Wagtail Admin site\n  are forced to login using two factor authentication.\n- ``WAGTAIL_2FA_OTP_TOTP_NAME`` (default: ``False``): The issuer name to\n  identify which site is which in your authenticator app. If not set and\n  ``WAGTAIL_SITE_NAME`` is defined it uses this. sets ``OTP_TOTP_ISSUER``\n  under the hood.\n\n\nMaking 2FA optional\n===================\n\nWith the default ``VerifyUserMiddleware`` middleware, 2FA is enabled for every user.\nTo make 2FA optional, use the ``VerifyUserPermissionsMiddleware`` middleware instead.\n\nTo do so, use the ``VerifyUserPermissionsMiddleware`` middleware instead of the ``VerifyUserMiddleware`` in your Django settings:\n\n.. code-block:: python\n\n    MIDDLEWARE = [\n        # ...\n        # 'wagtail_2fa.middleware.VerifyUserMiddleware',\n        'wagtail_2fa.middleware.VerifyUserPermissionsMiddleware',\n        # ...\n    ]\n\nWhen this middleware is used, a checkbox is added to the group permissions\nand 2FA can be enabled or disabled per group.\n\n2FA is always enabled for superusers, regardless of the middleware used.\n\n\nSandbox\n=======\n\nFirst create a new virtualenv with Python 3.8 and activate it. Then run\nthe following commands:\n\n.. code-block:: shell\n\n   make sandbox\n\n\nYou can then visit http://localhost:8000/admin/ and login with the following\ncredentials:\n\n- E-mail: ``superuser@example.com``\n- Password: ``testing``\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabd%2Fwagtail-2fa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabd%2Fwagtail-2fa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabd%2Fwagtail-2fa/lists"}