Skip to main content

Django app to implement two factor authentication with bootstrap modals

Project description

PyPI version

Adds to Django's authentication with 2FA option

  • 2FA with Authenticator app using TOTP
  • Use WebAuthn with Windows Hello, Face ID, Yubikey etc
  • Lock out by ip and username for too many failed attempts
  • Customisable Bootstrap 4 Modal interface with django-nested-modals
  • Cookie option to bypass 2FA (changing key to prevent copying of cookies)
  • Invite users by email to setup an account
  • Forgotten password function to email reset link

alt text

Installation

settings

from modal_2fa.settings_helper import modal_2fa_apps_admin
INSTALLED_APPS += [
    *modal_2fa_apps_admin,
]

OTP_TOTP_ISSUER = '**appname**'
AUTHENTICATION_BACKENDS = ['modal_2fa.auth.CookieBackend']        
LOGIN_URL ='/auth/login/'
LOGOUT_REDIRECT_URL = '/auth/login'

remove 'django.contrib.auth' from INSTALLED_APPS

urls

from modal_2fa.utils import get_custom_auth

urlpatterns += [
    path('', include(get_custom_auth().paths(include_admin=True))),    
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-modal-2fa-0.0.3.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

django_modal_2fa-0.0.3-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file django-modal-2fa-0.0.3.tar.gz.

File metadata

  • Download URL: django-modal-2fa-0.0.3.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for django-modal-2fa-0.0.3.tar.gz
Algorithm Hash digest
SHA256 de01b064b20be94d7bf1ac34491b3665c93afa03cf7a3f0b983472270d267c6e
MD5 d761ff17f0807458f81d5335c06325b1
BLAKE2b-256 e01731e8bac9862d7869c25571093b113d2bb4ada12f4f7885c8a69fc86dfd5d

See more details on using hashes here.

File details

Details for the file django_modal_2fa-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_modal_2fa-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7eccd1c3b6d4efeea005535c0a2894128f5a1d0aeebb8a704570d97affbe48ed
MD5 56de24f8f0cbbe2bc335d66123c0e4f6
BLAKE2b-256 b53818b282a66feedb1d373042a8e6916199f429952786f51f83b112b44243fe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page