Initial mfa support (for internal users) #93591

Merged
Oleg-Komarov merged 46 commits from mfa into main 2024-08-29 11:44:06 +02:00
Showing only changes of commit d648135f4a - Show all commits

View File

@ -8,13 +8,20 @@ I've also removed the "management" URLs, as we use the admin interface for that.
from django.urls import re_path from django.urls import re_path
from django.views.generic import RedirectView from django.views.generic import RedirectView
from oauth2_provider import views as default_oauth2_views from oauth2_provider import views as default_oauth2_views
from oauth2_provider import urls as default_oauth2_urls from oauth2_provider import urls as default_oauth2_urls
from otp_agents.decorators import otp_required
app_name = "oauth2_provider" app_name = "oauth2_provider"
urlpatterns = ( urlpatterns = (
re_path(r"^authorize/?$", default_oauth2_views.AuthorizationView.as_view(), name="authorize"), re_path(
r"^authorize/?$",
otp_required(accept_trusted_agent=True, if_configured=True)(
default_oauth2_views.AuthorizationView.as_view()
),
name="authorize",
),
re_path(r"^token/?$", default_oauth2_views.TokenView.as_view(), name="token"), re_path(r"^token/?$", default_oauth2_views.TokenView.as_view(), name="token"),
re_path( re_path(
r"^revoke/?$", r"^revoke/?$",