Package: django-allauth-webauthn
Welcome to django-allauth-webauthn!django-allauth-webauthnaddstwo-factor authenticationby using thewebauthnstandard todjango-allauth.
django-allauth is a set ofDjangoapplications which help with authentication, registration, and other account management tasks.Using thewebauthnstandard for the second authentication factor allows for a variety of authentication schemes on the client side.
The user may authenticate by using a roaming hardware token (e.g. a USB key or Bluetooth Low Energy device) or the operating system may provide the authentication functionality (e.g. Windows Hello).django-allauth-webauthndoes not implement thewebauthnstandard to allow forpassword-lesslogins.
It allows to authenticate a userafterthe usual login scheme against a pre-registered security token.
The user may pre-register an arbitrary amount of tokens.Source codehttp://github.com/cyberdeck/django-allauth-webauthnDocumentationhttps://django-allauth-webauthn.readthedocs.io/Main FeatureAddswebauthn-basedtwo-factor authenticationviews and workflow todjango-allauth.Compatibilitydjango-allauth-webauthnwas actively developed againstdjango-allauth0.45 usingDjango3.2 and Python 3.8.However, it includes exceptional testing aiming for 100% coverage and thus, you may test it easily against your version requirements.
If you need to patch it due to compatibility reasons I would love to see you contributing apull request.Where does it come from?django-allauth-webauthnwas created from scratch but it borrows a lot of ingredients fromdjango-allauth-2faanddjango-webauthin.
Both packages are exceptionally useful but does not included the feature to allow for awebauthn-basedtwo-factor authenticationout of the box.Contributingdjango-allauth-webauthnwas initially developed by H. Gregor Molter due to the lack of other suitablewebauthn-basedtwo-factor authenticationpackages.
Please feel free to contribute if you finddjango-allauth-webauthnuseful!Check for open issues or open a new issue to start a discussion around a bug or your special feature request.For therepositoryon GitHub and start to develop on themasterbranch or a custom branch derived from the master branch.Write one or multiple test(s) to allow for validation that the bug was fixed or that your special feature works as expected without any negative impact on the behavior of the other functionality.Before submitting your patch please thoroughly check your contribution by executing the pre-commit script.Send a pull request to get your changes merged and published.Developingdjango-allauth-webauthnmake heavy use of thepoetryPython packaging and dependency manager and thepre-commitframework.After you forked (and branched)django-allauth-webauthnplease install all development dependencies withpoetry:$poetryinstallpoetrywill install all needed development dependencies in a virtual environment for you.
Afterwards install thepre-commithooks by running:$poetryrunpre-commitinstallThe pre-commit hooks will be executed automatically prior committing to the Git repository.
There are hooks for source code styling (e.g. import reordering) and it is ensured that all tests may be executed successfully and that no obvious type checking issues are included.To execute these hooks manually (i.e. without performing a commit) execute the following:$poetryrunpre-commitrun--all-filesTestingTests can be run using the standard Django testing facility by executing:$poetryrunpythonmanage.pytestCoverageDuring test execution a coverage report can be created with:$poetryruncoveragerunmanage.pytestTo view the coverage report on the command line you have to execute:$poetryruncoveragereport-mor you can generate an HTML report for more eye candy:$poetryruncoveragehtmlThe resulting HTML report will be stored in thecoverage_htmlfolder.Demo ProjectA simple demo Django project is included within thedemofolder and may be run by:$cddemo# Migrate the demo database first (only needed once)$poetryrunpythonmanage.pymigrate# Run the SSL demo server (a self-signed certificate and private key is created during first run)$poetryrunpythonmanage.pyrunserver_plus--certtest.crtNoteThewebauthntechnology requires you to run your test server overhttps.
Otherwise the registration of security tokens or authentication cannot be executed successfully.
Some browser are a little bit piggy about self-signed certificates on127.0.0.1.
Please use at leasthttps://localhost:8000/to access the demo server and consult the web about your browser’s behavior before submitting an issue!The demo app allows you to register security tokens to a logged in user.
If a user has at least a single security token registered, she will be asked to authenticate with this token during sign in.
Security tokens may be renamed or deleted. All in one, it demonstrates the basic workflow forwebauthn-basedtwo-factor authentication.NoteIf you do not have a security token at hand or if you hesitate to use your super-secret token during development, you mayemulate authenticatorswith the Chrome browser.