Wagtail MFA
Wagtail MFA is a multi-factor authentication package for Wagtail. It adds an extra layer of security to your Wagtail admin interface.
Under the hood, Wagtail MFA uses django-otp and django-otp-webauthn to provide the Passkey login functionality. All this package does is provide a Wagtail-specific UI to let users manage their MFA settings and a page for MFA verification.
Screenshots
| Safari autofill prompt for saved Passkey | Login with fingerprint | Registered Passkeys |
|---|---|---|
|
|
|
|
Features
Supported authentication methods:
- Passkeys (passwordless login supported)
Coming soon:
- Time-based one-time passwords (TOTP)
- Recovery codes
Supported browsers
Passkeys are still a relatively new technology, and not all browsers support them reliably. The following browsers have been tested and are known to work with Passkeys:
- Chrome 125 on macOS 14
- Firefox 126 on macOS 14 (with known issues, see Known limitations
- Safari 17 on macOS 14
Requirements
- Python >= 3.9
- Django >= 4.2
- Wagtail >= 5.2
Installation
Install the package using pip:
pip install wagtail-mfa
Add all required apps to your INSTALLED_APPS:
# settings.py
INSTALLED_APPS = [
...
# Wagtail MFA must appear before wagtail because it overrides the default Wagtail login template
"wagtail_mfa",
...
# django-otp and django-otp-webauthn are required
"django_otp",
"django_otp_webauthn",
...
]
For Passkeys to work properly, you need to set some additional django_otp_webauthn settings.
Adapt and add the following code snippet to your settings.py:
# settings.py
OTP_WEBAUTHN_RP_ID = "your-domain.com"
OTP_WEBAUTHN_RP_NAME = WAGTAIL_SITE_NAME
OTP_WEBAUTHN_ALLOWED_ORIGINS = ["https://your-domain.com", "https://subdomain.your-domain.com"]
Configuration
OTP_WEBAUTHN_RP_ID
example: your-domain.com
This setting is the primary domain of your site. Passkeys are bound to this domain. This cannot be a 'public suffix' domain like your-app.compute.amazonaws.com or your-app.herokuapp.com. It must be a domain you own. Browsers will refuse to create Passkeys for public suffix domains. For a complete list of public suffix domains, see publicsuffix.org.
OTP_WEBAUTHN_RP_NAME
example: My Cool Wagtail Site
Some browsers show this name when registering a Passkey. This can be the name of your site or your company.
OTP_WEBAUTHN_ALLOWED_ORIGINS
example: ["https://your-domain.com", "https://subdomain.your-domain.com"]
This setting is similar to Django's CSRF_TRUSTED_ORIGINS setting and is used to verify Passkey registration/authentication requests. It must be a https:// (sub)domain of the OTP_WEBAUTHN_RP_ID. Do not include a trailing slash.
Known issues
- Issues on Firefox. When using Firefox to register and store a Passkey on an Android device, the Passkey will not be available to use for passwordless login. This is because Firefox does not create a
discoverable credential. This appears to be a limitation of Firefox. This issue was observed on Firefox 126 on macOS 14. - Multi-site has limited support. WebAuthn does not currently support using Passkeys across different domains. If you create a Passkey for
your-site.com, you cannot use it to authenticate onanother-site.com. Subdomains likesubdomain.your-site.comare supported however.
Development
See DEVELOPMENT.md for information on how to develop and contribute to this project.
License
This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.
Metadata
Release files for wagtail-mfa 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wagtail_mfa-0.1.0.tar.gz | 2.4 MB | Without provenance | Details for wagtail_mfa-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wagtail_mfa-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for wagtail_mfa-0.1.0-py3-none-any.whl |
Total release size: 2.4 MB
Release files / wagtail_mfa-0.1.0.tar.gz
| Download URL | wagtail_mfa-0.1.0.tar.gz |
|---|---|
| Size | 2.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a8c6c9356c30902cc9e09258a322d1e22ed3cf446fbbe1f3d732861a1c83b25
|
|
BLAKE2b-256 checksum How to use checksums |
1512349ac46fbcd5cf8b58dbde5eb6d4d914e998bba87276f042f9cd3c942ced
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.0
|
Release files / wagtail_mfa-0.1.0-py3-none-any.whl
| Download URL | wagtail_mfa-0.1.0-py3-none-any.whl |
|---|---|
| Size | 26.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2fc74701d2d6fc191c19cbb54218aaa40e3a2dfd25fd670950c787d82999857
|
|
BLAKE2b-256 checksum How to use checksums |
a7cfee70583fb8706ed4f7bf426598ee4ded6f6c8037c0f524cad2d170cd88e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.0
|
Security for wagtail-mfa 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.