Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
📢Announcement: Django OTP WebAuthn is still pretty new. Report any issues or suggestions on GitHub Issues.
Django OTP WebAuthn documentation
Django OTP WebAuthn documentation
  • Getting started
    • About passkeys
    • Quickstart
  • Customizing behavior
  • How-to guides
    • Customize views
    • Customize helper class
    • Customize models
    • Configure related origins
  • Reference
    • Views
    • Helper
    • Models
    • JSON request and response
  • Glossary
  • FAQ
  • Contributing
    • Style guide
    • reStructuredText usage
Back to top
View this page
Edit this page

Configure related origins¶

You can use WellKnownWebAuthnView to configure your application to use the same WebAuthn credentials across multiple domains. For example, if your main application runs on https://example.com and you have localized versions on https://example.co.uk and https://example.de.

Set up the URL¶

Modify your <project>/urls.py file and add the required URL configuration:

from django.urls import path
from django_otp_webauthn.views import WellKnownWebAuthnView

urlpatterns = [
    ...
    path(".well-known/webauthn", WellKnownWebAuthnView.as_view()),
]

Add related origins to your Django settings¶

Now in your <project>/settings.py file, add your related origins to OTP_WEBAUTHN_RP_RELATED_ORIGINS. The related origins must use HTTPS, except for localhost origins, which can use HTTP for local development:

OTP_WEBAUTHN_RP_RELATED_ORIGINS = [
    "https://example.com",
    "https://example.co.uk",
    "https://example.de",
    "https://app.example.com"
]

For more information, see the reference docs on WellKnownWebAuthnView.

Next
Reference
Previous
Customize models
Copyright © 2024 Stormbase and contributors. Licensed under the BSD-3-Clause License.
Made with Sphinx and @pradyunsg's Furo
On this page
  • Configure related origins
    • Set up the URL
    • Add related origins to your Django settings