authentik.core.urls

authentik URL Configuration

  1"""authentik URL Configuration"""
  2
  3from django.conf import settings
  4from django.contrib.auth.decorators import login_required
  5from django.urls import path
  6
  7from authentik.core.api.application_entitlements import ApplicationEntitlementViewSet
  8from authentik.core.api.applications import ApplicationViewSet
  9from authentik.core.api.authenticated_sessions import AuthenticatedSessionViewSet
 10from authentik.core.api.devices import AdminDeviceViewSet, DeviceViewSet
 11from authentik.core.api.groups import GroupViewSet
 12from authentik.core.api.property_mappings import PropertyMappingViewSet
 13from authentik.core.api.providers import ProviderViewSet
 14from authentik.core.api.sources import (
 15    GroupSourceConnectionViewSet,
 16    SourceViewSet,
 17    UserSourceConnectionViewSet,
 18)
 19from authentik.core.api.tokens import TokenViewSet
 20from authentik.core.api.transactional_applications import TransactionalApplicationView
 21from authentik.core.api.users import UserViewSet
 22from authentik.core.views.apps import RedirectToAppLaunch
 23from authentik.core.views.debug import AccessDeniedView
 24from authentik.core.views.interface import (
 25    BrandDefaultRedirectView,
 26    InterfaceView,
 27    RootRedirectView,
 28)
 29from authentik.flows.views.interface import FlowInterfaceView
 30from authentik.root.asgi_middleware import AuthMiddlewareStack
 31from authentik.root.middleware import ChannelsLoggingMiddleware
 32from authentik.root.ws.consumer import MessageConsumer
 33from authentik.tenants.channels import TenantsAwareMiddleware
 34
 35urlpatterns = [
 36    path(
 37        "",
 38        login_required(RootRedirectView.as_view()),
 39        name="root-redirect",
 40    ),
 41    path(
 42        # We have to use this format since everything else uses application/o or application/saml
 43        "application/launch/<slug:application_slug>/",
 44        RedirectToAppLaunch.as_view(),
 45        name="application-launch",
 46    ),
 47    # Interfaces
 48    path(
 49        "if/admin/",
 50        BrandDefaultRedirectView.as_view(template_name="if/admin.html"),
 51        name="if-admin",
 52    ),
 53    path(
 54        "if/user/",
 55        BrandDefaultRedirectView.as_view(template_name="if/user.html"),
 56        name="if-user",
 57    ),
 58    path(
 59        "if/flow/<slug:flow_slug>/",
 60        # FIXME: move this url to the flows app...also will cause all
 61        # of the reverse calls to be adjusted
 62        FlowInterfaceView.as_view(),
 63        name="if-flow",
 64    ),
 65    # Fallback for WS
 66    path("ws/outpost/<uuid:pk>/", InterfaceView.as_view(template_name="if/admin.html")),
 67    path(
 68        "ws/client/",
 69        InterfaceView.as_view(template_name="if/admin.html"),
 70    ),
 71]
 72
 73api_urlpatterns = [
 74    ("core/authenticated_sessions", AuthenticatedSessionViewSet),
 75    ("core/applications", ApplicationViewSet),
 76    ("core/application_entitlements", ApplicationEntitlementViewSet),
 77    path(
 78        "core/transactional/applications/",
 79        TransactionalApplicationView.as_view(),
 80        name="core-transactional-application",
 81    ),
 82    ("core/groups", GroupViewSet),
 83    ("core/users", UserViewSet),
 84    ("core/tokens", TokenViewSet),
 85    ("sources/all", SourceViewSet),
 86    ("sources/user_connections/all", UserSourceConnectionViewSet),
 87    ("sources/group_connections/all", GroupSourceConnectionViewSet),
 88    ("providers/all", ProviderViewSet),
 89    ("propertymappings/all", PropertyMappingViewSet),
 90    ("authenticators/all", DeviceViewSet, "device"),
 91    (
 92        "authenticators/admin/all",
 93        AdminDeviceViewSet,
 94        "admin-device",
 95    ),
 96]
 97
 98websocket_urlpatterns = [
 99    path(
100        "ws/client/",
101        ChannelsLoggingMiddleware(
102            TenantsAwareMiddleware(AuthMiddlewareStack(MessageConsumer.as_asgi()))
103        ),
104    ),
105]
106
107if settings.DEBUG:
108    urlpatterns += [
109        path("debug/policy/deny/", AccessDeniedView.as_view(), name="debug-policy-deny"),
110    ]
urlpatterns = [<URLPattern '' [name='root-redirect']>, <URLPattern 'application/launch/<slug:application_slug>/' [name='application-launch']>, <URLPattern 'if/admin/' [name='if-admin']>, <URLPattern 'if/user/' [name='if-user']>, <URLPattern 'if/flow/<slug:flow_slug>/' [name='if-flow']>, <URLPattern 'ws/outpost/<uuid:pk>/'>, <URLPattern 'ws/client/'>]
api_urlpatterns = [('core/authenticated_sessions', <class 'authentik.core.api.authenticated_sessions.AuthenticatedSessionViewSet'>), ('core/applications', <class 'authentik.core.api.applications.ApplicationViewSet'>), ('core/application_entitlements', <class 'authentik.core.api.application_entitlements.ApplicationEntitlementViewSet'>), <URLPattern 'core/transactional/applications/' [name='core-transactional-application']>, ('core/groups', <class 'authentik.core.api.groups.GroupViewSet'>), ('core/users', <class 'authentik.core.api.users.UserViewSet'>), ('core/tokens', <class 'authentik.core.api.tokens.TokenViewSet'>), ('sources/all', <class 'authentik.core.api.sources.SourceViewSet'>), ('sources/user_connections/all', <class 'authentik.core.api.sources.UserSourceConnectionViewSet'>), ('sources/group_connections/all', <class 'authentik.core.api.sources.GroupSourceConnectionViewSet'>), ('providers/all', <class 'authentik.core.api.providers.ProviderViewSet'>), ('propertymappings/all', <class 'authentik.core.api.property_mappings.PropertyMappingViewSet'>), ('authenticators/all', <class 'authentik.core.api.devices.DeviceViewSet'>, 'device'), ('authenticators/admin/all', <class 'authentik.core.api.devices.AdminDeviceViewSet'>, 'admin-device')]
websocket_urlpatterns = [<URLPattern 'ws/client/'>]