Passkey authentication for Django
Project description
Installation
pip install django-passkey-auth
- Add
passkeys
to yourINSTALLED_APPS
setting - Include
passkeys.urls
somewhere in yoururls.py
(auth/passkey/
for example) - Migrate your database
Integration with the Django admin
django-passkey-auth
comes with some basic admin template overrides that make it
possible to register and authenticate with a passkey to the Django admin. To use these
customizations, add passkeys.template_directory
to your TEMPLATES["DIRS"]
list.
The next time you log into the admin, a "Register Passkey" link will be available in the user links at the top. Once you have registered a passkey, you can use the "Passkey Login" button available on the admin login form.
Integration with your site
- Add
<script src="{% static 'passkeys/passkeys.js' %}" defer></script>
to your login page, and any page where you may want to allow users to register a passkey. - Add a button to allow users to register a passkey:
<button onclick="registerPasskey('{% url "passkey-register" %}', '{% url "home" %}')">Register Passkey</button>
- Add a button to your login page to allow users to authenticate with a passkey:
<button onclick="authenticatePasskey('{% url "passkey-login" %}', '{% url "home" %}')">Passkey Login</button>
Javascript functions
The passkeys.js
script contains two functions:
async function registerPasskey(endpoint, redirect)
async function authenticatePasskey(endpoint, redirect)
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for django-passkey-auth-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92e29e38eb96317ec9bd230587996905c51c412ce64153f51f0eaf5c15d3083b |
|
MD5 | 06f9971759191641291da18719f47ced |
|
BLAKE2b-256 | 678251ea1d21463064e3b62c65f5f8a132188125c47b71360c787626e601296c |
Close
Hashes for django_passkey_auth-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7a44e071f4ce86c332e582f039c8bf36e32da7cbc36db23957441bbec541233 |
|
MD5 | 8cd19a5313b30ec5710db77d3962ce42 |
|
BLAKE2b-256 | 2122d7dc977acabd04e008e55b4966c49c27537493dd36aea9d04c327f808dd3 |