Django application for FIDO protocol
Django-fido provides basic components for FIDO 2 authentication - model to store user's FIDO 2 authenticator data and basic views.
- Python 3.5 and higher
- Django >= 1.11
-
Add
django_fido
toINSTALLED_APPS
. -
Add
django_fido.backends.Fido2AuthenticationBackend
toAUTHENTICATION_BACKENDS
. -
Link django-fido URLs into your
urls.py
:urlpatterns += [ url(r'', include('django_fido.urls')), ]
-
If you wish, set string variable
DJANGO_FIDO_RP_NAME
.
You can also decide to use one step authentication. In this case, you will use just one authentication form, that will collect username, password and FIDO2 credentials. In addition to the configuration above, you also need to:
- Set
DJANGO_FIDO_TWO_STEP_AUTH
toFalse
. - Replace
django_fido.backends.Fido2AuthenticationBackend
withdjango_fido.backends.Fido2GeneralAuthenticationBackend
inAUTHENTICATION_BACKENDS
. - Set
DJANGO_FIDO_AUTHENTICATION_BACKENDS
to the list of your additional authentication backends, if you use others thandjango.contrib.auth.backends.ModelBackend
. - Set
data-autosubmit-off
attribute on the form element of your login page.
Please note that your login form must have a field named username
, even if your USERNAME_FIELD
is not username
.
See changelog.
Use tox
to run tests
tox
See LICENSE.