Skip to content

Commit

Permalink
Allow disabling 2FA
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Mar 14, 2024
1 parent b68b437 commit e3f28ca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Change history
==============

2.3.0 (TBD)
-----------

.. warning::

Two-factor authentication is enabled by default. The ``DISABLE_2FA`` environment variable
can be used to disable it if needed.

2.2.1 (2024-03-02)
------------------

Expand Down
3 changes: 3 additions & 0 deletions docs/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ Other settings
traefik, Apache...). Default ``False`` - this is a header that can be spoofed and you
need to ensure you control it before enabling this.

* ``DISABLE_2FA``: whether to disable two-factor authentication. Defaults to ``False``.
If set to ``False``, 2FA will be required if not using OIDC.

Initial superuser creation
--------------------------

Expand Down
3 changes: 3 additions & 0 deletions src/objects/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,9 @@
"mozilla_django_oidc_db.backends.OIDCAuthenticationBackend",
]

if config("DISABLE_2FA", default=False): # pragma: no cover
MAYKIN_2FA_ALLOW_MFA_BYPASS_BACKENDS = AUTHENTICATION_BACKENDS

#
# Mozilla Django OIDC DB settings
#
Expand Down

0 comments on commit e3f28ca

Please sign in to comment.