2020-12-05 21:08:42 +00:00
|
|
|
"""authentik URL Configuration"""
|
2022-04-21 20:38:32 +00:00
|
|
|
from django.conf import settings
|
2021-03-22 12:44:17 +00:00
|
|
|
from django.contrib.auth.decorators import login_required
|
2019-06-25 16:00:54 +00:00
|
|
|
from django.urls import path
|
2021-03-22 12:44:17 +00:00
|
|
|
from django.views.decorators.csrf import ensure_csrf_cookie
|
|
|
|
from django.views.generic import RedirectView
|
2018-11-11 12:41:48 +00:00
|
|
|
|
2022-02-23 21:48:55 +00:00
|
|
|
from authentik.core.views import apps, impersonate
|
2022-04-21 20:38:32 +00:00
|
|
|
from authentik.core.views.debug import AccessDeniedView
|
2022-07-28 22:02:48 +00:00
|
|
|
from authentik.core.views.interface import FlowInterfaceView, InterfaceView
|
2021-06-06 12:07:50 +00:00
|
|
|
from authentik.core.views.session import EndSessionView
|
2018-11-11 12:41:48 +00:00
|
|
|
|
2019-06-25 16:00:54 +00:00
|
|
|
urlpatterns = [
|
2021-03-22 12:44:17 +00:00
|
|
|
path(
|
|
|
|
"",
|
2022-06-30 20:37:29 +00:00
|
|
|
login_required(
|
|
|
|
RedirectView.as_view(pattern_name="authentik_core:if-user", query_string=True)
|
|
|
|
),
|
2021-03-22 12:44:17 +00:00
|
|
|
name="root-redirect",
|
|
|
|
),
|
2022-02-23 21:48:55 +00:00
|
|
|
path(
|
|
|
|
# We have to use this format since everything else uses applications/o or applications/saml
|
|
|
|
"application/launch/<slug:application_slug>/",
|
|
|
|
apps.RedirectToAppLaunch.as_view(),
|
|
|
|
name="application-launch",
|
|
|
|
),
|
2020-09-17 14:24:53 +00:00
|
|
|
# Impersonation
|
|
|
|
path(
|
|
|
|
"-/impersonation/<int:user_id>/",
|
|
|
|
impersonate.ImpersonateInitView.as_view(),
|
|
|
|
name="impersonate-init",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"-/impersonation/end/",
|
|
|
|
impersonate.ImpersonateEndView.as_view(),
|
|
|
|
name="impersonate-end",
|
|
|
|
),
|
2021-03-22 12:44:17 +00:00
|
|
|
# Interfaces
|
|
|
|
path(
|
|
|
|
"if/admin/",
|
2022-07-28 22:02:48 +00:00
|
|
|
ensure_csrf_cookie(InterfaceView.as_view(template_name="if/admin.html")),
|
2021-03-22 12:44:17 +00:00
|
|
|
name="if-admin",
|
|
|
|
),
|
2021-09-16 15:30:16 +00:00
|
|
|
path(
|
|
|
|
"if/user/",
|
2022-07-28 22:02:48 +00:00
|
|
|
ensure_csrf_cookie(InterfaceView.as_view(template_name="if/user.html")),
|
2021-09-16 15:30:16 +00:00
|
|
|
name="if-user",
|
|
|
|
),
|
2021-03-22 12:44:17 +00:00
|
|
|
path(
|
|
|
|
"if/flow/<slug:flow_slug>/",
|
2021-06-05 18:04:30 +00:00
|
|
|
ensure_csrf_cookie(FlowInterfaceView.as_view()),
|
2021-03-22 12:44:17 +00:00
|
|
|
name="if-flow",
|
|
|
|
),
|
2021-06-06 11:24:27 +00:00
|
|
|
path(
|
|
|
|
"if/session-end/<slug:application_slug>/",
|
|
|
|
ensure_csrf_cookie(EndSessionView.as_view()),
|
|
|
|
name="if-session-end",
|
|
|
|
),
|
2021-06-03 15:20:44 +00:00
|
|
|
# Fallback for WS
|
2022-07-28 22:02:48 +00:00
|
|
|
path("ws/outpost/<uuid:pk>/", InterfaceView.as_view(template_name="if/admin.html")),
|
2021-06-03 15:20:44 +00:00
|
|
|
path(
|
|
|
|
"ws/client/",
|
2022-07-28 22:02:48 +00:00
|
|
|
InterfaceView.as_view(template_name="if/admin.html"),
|
2021-06-03 15:20:44 +00:00
|
|
|
),
|
2018-11-16 08:10:35 +00:00
|
|
|
]
|
2022-04-21 20:38:32 +00:00
|
|
|
|
|
|
|
if settings.DEBUG:
|
|
|
|
urlpatterns += [
|
|
|
|
path("debug/policy/deny/", AccessDeniedView.as_view(), name="debug-policy-deny"),
|
|
|
|
]
|