django-passkeys is an extension to the Django ModelBackend, enabling seamless user login via passkeys. This innovative solution simplifies authentication by leveraging the Web Authentication API, making it compatible with various devices and platforms, including the Apple ecosystem and Chromium-based browsers.
django-passkeys is a powerful Django extension designed to enhance user authentication by integrating support for passkeys. This innovative approach leverages the Web Authentication API, enabling users to log in securely using another device, effectively phasing out traditional passwords for enrolled users.
To integrate django-passkeys into your application:
passkeys to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = (
'......',
'passkeys',
'......'
)
AUTHENTICATION_BACKENDS = ['passkeys.backend.PasskeyModelBackend']
FIDO_SERVER_ID = "localhost"
FIDO_SERVER_NAME = "TestApp"
import passkeys
KEY_ATTACHMENT = None | passkeys.Attachment.CROSS_PLATFORM | passkeys.Attachment.PLATFORM
urls.py:
urlpatterns = [
'...',
url(r'^passkeys/', include('passkeys.urls')),
'....',
]
user = authenticate(request, username=request.POST["username"], password=request.POST["password"])
Once integrated, you can easily check if a user has utilized a passkey during login. The session will contain a passkey key that indicates whether the user logged in via passkey:
{'passkey': True, 'name': 'Chrome', 'id': 2, 'platform': 'Chrome on Apple', 'cross_platform': False}
Starting from version v1.2, add webauthn to the autocomplete field to prompt users to use passkeys, providing a smoother and more secure authentication process.
<input name="username" placeholder="username" autocomplete="username webauthn">
With contributions from dedicated developers and ongoing improvements, django-passkeys is on the cutting edge of authentication technology in Django applications. Join the movement toward password-free and secure user experiences today!
No comments yet.
Sign in to be the first to comment.