Skip to main content

Passwordless authentication using WebAuthn.

Project description

WebAuthin'

WARNING: This library is still somewhat of an alpha version, though it should mostly work.

About

WebAuthin' is a Django library for secure, passwordless logins using WebAuthn/FIDO2.

It allows users to associate secure keys (from USB keys like Yubikeys, Titan keys, etc to platform authenticators like OS X's TouchID) with your website and log in just by plugging the key in. This means they don't need to remember a username/password, there are no credentials to steal, and they don't need a second factor.

WebAuthin' requires user verification, which means that the user will need to enter a PIN, fingerprint, or some other method of verification locally, to prevent theft of the physical key from allowing logins.

WebAuthn is currently only supported on a few browsers (Chrome on the desktop, somewhat on Firefox on Android, possibly Safari on iOS).

PyPI version

Installing django-webauthin

  • First of all, make sure that your site uses the Sites framework properly, as that is what WebAuthin' currently uses to get your site name and domain. In the future, settings will be added so you won't need to do this.

  • Install django-webauthin using pip: pip install django-webauthin

  • Add webauthin to your INSTALLED_APPS:

# settings.py
INSTALLED_APPS = [... "webauthin", ...]
  • Add webauthin to your authentication backends:
AUTHENTICATION_BACKENDS = (
    "webauthin.auth_backends.WebAuthinBackend",
    "django.contrib.auth.backends.ModelBackend",
)
  • Add the webauthin URL to your urls.py:
# urls.py
urlpatterns += path("auth/", include("webauthin.urls", namespace="webauthin"))
  • You now need two buttons, one for registration and one for login. The registration button should have an ID of webauthin-register. You also need to include a template that will insert the JS code somewhere:
{% include "webauthin_register.html" %}
<button id="webauthin-register">Register new key</button>

Pressing this button will trigger the key registration flow.

  • Add the login button to your login form, as above, this time with an ID of webauthin-login:
{% include "webauthin_login.html" %}
<button id="webauthin-login">Log in using hardware key</button>
  • You can also add a table to allow the user to see and delete their registered keys, though this process is currently somewhat manual:
def account_view(request):
    return render(request, "account.html", {"keys": request.user.authdata_set.all()}
{% for key in keys %}
<p>
    Created on {{ key.created_on }} and last used on {{ key.last_used_on }}.
</p>
{% endfor %}

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

django-webauthin-0.0.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distributions

django_webauthin-0.0.1-py3.7.egg (25.6 kB view details)

Uploaded Source

django_webauthin-0.0.1-py2.py3-none-any.whl (16.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-webauthin-0.0.1.tar.gz.

File metadata

  • Download URL: django-webauthin-0.0.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for django-webauthin-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3a8cca169b72074c2896900db755807f2f8ced41a3cbde6835db2548691efeb6
MD5 69abf3354ac5f6fa5b55bcb0676cf32a
BLAKE2b-256 4bf2211657b1a39013cae6a9ad4142b9cb824c0518bf38d9283cb5bdc2676cff

See more details on using hashes here.

File details

Details for the file django_webauthin-0.0.1-py3.7.egg.

File metadata

  • Download URL: django_webauthin-0.0.1-py3.7.egg
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for django_webauthin-0.0.1-py3.7.egg
Algorithm Hash digest
SHA256 9f333fc2c564d47fcf721b4a15aa4037dfeacb950256836904fd9377c05ad0e8
MD5 3d0aeb52ab4467aafe15d6a7cfa4bb03
BLAKE2b-256 7e491fdf045da8c728301b7b6dac54e6ec7f28ba56cc2324525a6d8d1e896214

See more details on using hashes here.

File details

Details for the file django_webauthin-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: django_webauthin-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for django_webauthin-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6d04cbc09e0017f7cb99eb0c6be2ded23d454d58d73459ead37ae13fe5f6e69c
MD5 0d93fb4b0cb58823ec3056e211b29691
BLAKE2b-256 89dd1cfe22abf0d47939155abcc6754ea6f402707ac02d1751884c51452a33fb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page