Two Factor Authentication in Django using Web Authentication API (WebAuthn).
Project description
Two Factor Authentication in Django using Web Authentication API (WebAuthn).
Quick start
Add “webauth” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'webauth', ]
Include the webauth URLconf in your project urls.py like this:
path('webauth/', include('webauth.urls')),
Add webauth.backends.WebAuthnBackend to AUTHENTICATION_BACKENDS setting:
AUTHENTICATION_BACKENDS = [ 'django.contrib.auth.backends.ModelBackend', 'webauth.backends.WebAuthnBackend', ]
Add webauth.mixins.WebAuthnRequiredMixin to any views you want to protect with WebAuthn:
from webauth.mixins import WebAuthnRequiredMixin class AuthorList(WebAuthnRequiredMixin, ListView): ...
Only class-based views are currently supported.
Run python manage.py migrate to create the webauth models.
Start the development server and visit http://127.0.0.1:8000/webauth/keys/ to register a WebAuthn credential.
Visit http://127.0.0.1:8000/webauth/auth/ to test your new authenticator.
When visiting views marked with WebAuthnRequiredMixin, you will have to authenticate using a credential you created in step 6 if not already done so for the current session. Traditional authentication (username and password) is also required. The WebAuthnRequiredMixin will use redirects to complete any required authentication.
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
Built Distribution
Hashes for django_webauth-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ed99f74b8d68b541412f40f45614e3b5894c5fbb2dfd4517c22a46ba4ec89e6 |
|
MD5 | ef5e2bdf9cd8ef855b59744d6da3ce7b |
|
BLAKE2b-256 | 6b37a03f9ce5f3db86ad201b913cc680c819f0575494a9acb81aa8f1a9132605 |