Skip to content

Commit

Permalink
feat: Add WebAuthn (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverben authored Dec 9, 2023
1 parent 5de80ad commit ff9faa3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions LedenAdministratie/settings.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ DEBUG = True

ALLOWED_HOSTS = []

# Required in production for WebAuthn
# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')


# Application definition

Expand All @@ -35,6 +38,7 @@ INSTALLED_APPS = [
'django_otp.plugins.otp_static',
'django_otp.plugins.otp_totp',
'two_factor',
'two_factor.plugins.webauthn',
'LedenAdministratie'
]

Expand Down Expand Up @@ -99,6 +103,7 @@ LOGIN_URL = 'two_factor:login'
LOGIN_REDIRECT_URL = '/logged_in/'

TWO_FACTOR_REMEMBER_COOKIE_AGE = 30 * 24 * 3600
TWO_FACTOR_WEBAUTHN_RP_NAME = 'DJO Amersfoort'

EMAIL_HOST="smtp.provider.com"
EMAIL_PORT=587
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ requests==2.31.0
requests-oauthlib==1.3.1
weasyprint==58.1
django-two-factor-auth[phonenumberslite]==1.15.1
django-two-factor-auth[webauthn]
1 change: 1 addition & 0 deletions templates/registration/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<script src="{% static 'js/theme.js' %}"></script>
{% block customscript %}{% endblock %}
{% block head %}{% endblock %}
{% block extra_media %}{% endblock %}
</head>

<body>
Expand Down
4 changes: 4 additions & 0 deletions templates/two_factor/core/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
{% load widget_tweaks %}
{% load two_factor_tags %}

{% block extra_media %}
{{ form.media }}
{% endblock %}

{% block head %}
<div class="loader">
<div class="spinner-border" role="status">
Expand Down

0 comments on commit ff9faa3

Please sign in to comment.