Package: django-fido
django-fidoDjango application for FIDO protocolDjango-fido provides basic components for FIDO 2 authentication - model to store user's FIDO 2 authenticator data and basic views.Table of ContentsDependenciesConfigurationChangesTestingLicenseDependenciesPython 3.5 and higherDjango >= 3.0ConfigurationAdddjango_fidotoINSTALLED_APPS.Adddjango_fido.backends.Fido2AuthenticationBackendtoAUTHENTICATION_BACKENDS.Link django-fido URLs into yoururls.py:urlpatterns += [
   url(r'', include('django_fido.urls')),
]If you wish, set string variableDJANGO_FIDO_RP_NAME.Extra configurationDJANGO_FIDO_RESIDENT_KEYDefault: FalsePurpose: Set to True to enable discoverable credentials, private key and associated metadata is stored in persistent memory on the authenticator. This is useful for passwordless authentication.One step authenticationYou 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:SetDJANGO_FIDO_TWO_STEP_AUTHtoFalse.Replacedjango_fido.backends.Fido2AuthenticationBackendwithdjango_fido.backends.Fido2GeneralAuthenticationBackendinAUTHENTICATION_BACKENDS.SetDJANGO_FIDO_AUTHENTICATION_BACKENDSto the list of your additional authentication backends, if you use others
thandjango.contrib.auth.backends.ModelBackend.Setdata-autosubmit-offattribute on the form element of your login page.Please note that your login form must have a field namedusername, even if yourUSERNAME_FIELDis notusername.Metadata downloadIf you want to be able to download authenticator metadata, you need to setDJANGO_FIDO_METADATA_SERVICEsetting which is a dictionary.
The MDS is available in two versions v2 (deprecated) and v3 (current).
If you want to use MDSv2, you have to set a validACCESS_TOKEN.
If you want to use MDSv3, you have to setMDS_FORMATto3and set a validURLproviding the MDSv3 data.
Then you can periodically run thedownload_authenticator_metadatamanagement command.
If metadata are available for the givenAuthenticator, itsmetadataproperty will be an object.
Thelevel,vulnerabilitiesandis_update_availablemethods onmetadatacan be used to determine the trust and certification level.PasswordlessThis authentication requires "discoverable credential" and using that credential to perform a user lookup using the passwordless authentication backendSetDJANGO_FIDO_RESIDENT_KEYtoTrueSet 'DJANGO_FIDO_PASSWORDLESS_AUTH' to 'True'Set 'DJANGO_FIDO_TWO_STEP_AUTH' to 'False'Replacedjango_fido.backends.Fido2AuthenticationBackendwithdjango_fido.backends.Fido2PasswordlessAuthenticationBackendinAUTHENTICATION_BACKENDS.Set user verification requirementSetDJANGO_FIDO_USER_VERIFICATIONtorequired,preferredordiscouraged, default isNoneChangesSeechangelog.TestingUsetoxto run teststoxLicenseSeeLICENSE.Changelog1.2.1Fixed metadata lookup for devices with device certificate directly in MDS1.2.0Changed redirect after adding authenticator in administration to changelist instead of change viewMadeuser_handlein admin readonlyUpgrade to nodejs 18.xFixed resident key registration1.1.0Add support for fido2 1.1Drop support for fido2 < 1.1Export js translations for optional modifications1.0.1Pin fido2 dependency1.0.0Add support for fido2 1.0Drop support for fido2 < 1.0Provide fido2 JS functions without side effects0.43Handle InvalidStateErrorDropFIDO_CERTIFIEDfromAUTH_LEVELS0.42Export createTranslations function in fido2.js0.41Fix reversing of the order of statusReports in metadata0.40Pin fido2 to ~= 0.9Drop support for Django 2.xFix package build with setuptools-npm0.39Fix uncaught exception when user does not exist0.38Fix Authenticator.metadata if no identifier is presentAdded passwordless auth backend0.37Drop support for Django 1.11Drop support for python 3.5Sets a default_auto_fieldFix django.conf.urls deprecation warningsAdded user_handle field to Authenticator modelAdded DJANGO_FIDO_RESIDENT_KEY (default False) app settingRestructured js handling key registration and exposed additional functions0.36Sort users in admin Authenticator add form by usernameSort statusReport dictionary in metadata0.35Change authenticate request arg to positionalFix metadata for empty credential_dataBump path-parse from 1.0.6 to 1.0.7Proper cleanup of database model under MDS30.34Fix MDS3 metadata verification0.33Support for MDSv3 AuthenticatorMetadata0.32Fix authentication for devices without counter support0.31Support forfido2library>0.9.0Add tests under django 3.1Handle when multiple device metadata are returnedJS fixes and updates0.30Counter is now stored as BigInteger.Restrict version offido2library to<0.9.0.0.29CatchInvalidAttestationerror in registration view.0.28Updated error strings to be more informative.0.27Throw form error on unknown attestation format instead of a server error.0.26Improve metadata matching for U2F authenticators.0.25BREAKING- AuthenticatorMetadata are now looked up by URL and not by an identifier. If you are downloading metadata, you need to clear them all and re-download to prevent multiple objects for each authenticator.Update JS dependencies0.24Metadata validation0.23Display no authenticator errorerrorkey in repsponse ofBaseFido2RequestViewis now deprecated and will be removed in the futureAdded metadata download and reporting0.22Use username as a backupdisplayName0.21Create FIDO errors list when needed unless it already existsClear FIDO errors list before each registration or authentication request0.20Fix Django 3.0 compatibility issues in templates0.19Added class attributeattestation_typestoFido2ViewMixinto specify allowed attestation types during registration.Set default value of settingDJANGO_FIDO_AUTHENTICATION_BACKENDSto list containingdjango.contrib.auth.backends.ModelBackend0.18Fix issue caused by default value ofDJANGO_FIDO_AUTHENTICATION_BACKENDS. It is now empty list.0.17BREAKINGReplaceFido2ModelAuthenticationBackendwith more generalFido2GeneralAuthenticationBackend.0.16BREAKINGAuthenticatorlabelhas to be unique for user. This can potentialy break if you have multiple tokens for user.Add authenticator admin.Add one step authentication.0.15AddDJANGO_FIDO_RP_NAMEsetting.Add back autosubmit on login view.Display error in login view on server request error.0.14Add label to Authenticator model.Remove autosubmit on registration view.Update JS dependencies.0.13Support fido2 0.6-0.8.Add support for python 3.8.Fixup annotations.0.12Fix dependencies (add webpack-cli).0.11Fix webpack output path.0.10Fix dependencies (add webpack).0.9Refactor JS code.Update setup.Add bumpversion.0.8Fix JS translation lazynes.For empty values, submit button reload page.0.7Add credential ID field.Dropcredential_datafield.Update error messages.Mark django-fido as typed.Add JS hooks.0.6Use FIDO 2 instead of U2F.Drop python 2.7.Add annotations and mypy check.Move repository to a CZ.NIC account.0.5Fix JS translation lazynes0.4Update JS messages.Drop unusedpolintenvironment in tox.0.3Store attestation certificate in database #6Install package data #70.2Accept any arguments inBaseU2fRequestView.getAdd czech translationsFix links in README0.1Initial version