def dispatch(self, request, organization_slug): # NB: The 'auth' key is used in the helper in_auth_flow = request.session.get('auth', False) # SP initiated authentication if in_auth_flow: from sentry.web.frontend.auth_provider_login import AuthProviderLoginView sso_login = AuthProviderLoginView() return sso_login.handle(request) # IdP initiated authentication. Start from org login flow from sentry.web.frontend.auth_organization_login import AuthOrganizationLoginView # AuthOranizationLogin will init the login flow *only if* the ``init`` # parameter is set. request.POST = request.POST.copy() request.POST['init'] = True org_login = AuthOrganizationLoginView() return org_login.handle(request, organization_slug)
r"^metadata/(?P<organization_slug>[^/]+)/$", SAML2MetadataView.as_view(), name="sentry-auth-organization-saml-metadata", ), ] ), ), # Auth url( r"^auth/", include( [ url(r"^login/$", AuthLoginView.as_view(), name="sentry-login"), url( r"^login/(?P<organization_slug>[^/]+)/$", AuthOrganizationLoginView.as_view(), name="sentry-auth-organization", ), url( r"^link/(?P<organization_slug>[^/]+)/$", AuthOrganizationLoginView.as_view(), name="sentry-auth-link-identity", ), url(r"^2fa/$", TwoFactorAuthView.as_view(), name="sentry-2fa-dialog"), url(r"^2fa/u2fappid\.json$", u2f_appid, name="sentry-u2f-app-id"), url(r"^sso/$", AuthProviderLoginView.as_view(), name="sentry-auth-sso"), url(r"^logout/$", AuthLogoutView.as_view(), name="sentry-logout"), url( r"^reactivate/$", ReactivateAccountView.as_view(), name="sentry-reactivate-account",
# OAuth url(r'^oauth/authorize/$', OAuthAuthorizeView.as_view()), url(r'^oauth/token/$', OAuthTokenView.as_view()), # SAML url(r'^saml/acs/(?P<organization_slug>[^/]+)/$', SAML2AcceptACSView.as_view(), name='sentry-auth-organization-saml-acs'), url(r'^saml/sls/(?P<organization_slug>[^/]+)/$', SAML2SLSView.as_view(), name='sentry-auth-organization-saml-sls'), url(r'^saml/metadata/(?P<organization_slug>[^/]+)/$', SAML2MetadataView.as_view(), name='sentry-auth-organization-saml-metadata'), # Auth url( r'^auth/link/(?P<organization_slug>[^/]+)/$', AuthOrganizationLoginView.as_view(), name='sentry-auth-link-identity' ), url(r'^auth/login/$', AuthLoginView.as_view(), name='sentry-login'), url( r'^auth/login/(?P<organization_slug>[^/]+)/$', AuthOrganizationLoginView.as_view(), name='sentry-auth-organization' ), url(r'^auth/2fa/$', TwoFactorAuthView.as_view(), name='sentry-2fa-dialog'), url(r'^auth/2fa/u2fappid\.json$', u2f_appid, name='sentry-u2f-app-id'), url(r'^auth/sso/$', AuthProviderLoginView.as_view(), name='sentry-auth-sso'), url(r'^auth/logout/$', AuthLogoutView.as_view(), name='sentry-logout'), url(r'^auth/reactivate/$', ReactivateAccountView.as_view(), name='sentry-reactivate-account'), url(r'^auth/register/$', AuthLoginView.as_view(), name='sentry-register'),
# API url(r'^api/0/', include('sentry.api.urls')), url(r'^api/hooks/mailgun/inbound/', MailgunInboundWebhookView.as_view(), name='sentry-mailgun-inbound-hook'), url(r'^api/hooks/release/(?P<plugin_id>[^/]+)/(?P<project_id>[^/]+)/(?P<signature>[^/]+)/', ReleaseWebhookView.as_view(), name='sentry-release-hook'), url(r'^api/embed/error-page/$', ErrorPageEmbedView.as_view(), name='sentry-error-page-embed'), # OAuth url(r'^oauth/authorize/$', OAuthAuthorizeView.as_view()), url(r'^oauth/token/$', OAuthTokenView.as_view()), # Auth url(r'^auth/link/(?P<organization_slug>[^/]+)/$', AuthOrganizationLoginView.as_view(), name='sentry-auth-link-identity'), url(r'^auth/login/$', AuthLoginView.as_view(), name='sentry-login'), url(r'^auth/login/(?P<organization_slug>[^/]+)/$', AuthOrganizationLoginView.as_view(), name='sentry-auth-organization'), url(r'^auth/2fa/$', TwoFactorAuthView.as_view(), name='sentry-2fa-dialog'), url(r'^auth/2fa/u2fappid\.json$', u2f_appid, name='sentry-u2f-app-id'), url(r'^auth/sso/$', AuthProviderLoginView.as_view(), name='sentry-auth-sso'), url(r'^auth/logout/$', AuthLogoutView.as_view(), name='sentry-logout'), url(r'^auth/reactivate/$', ReactivateAccountView.as_view(), name='sentry-reactivate-account'),
# The static version is either a 10 digit timestamp, a sha1, or md5 hash url(r'^_static/(?:(?P<version>\d{10}|[a-f0-9]{32,40})/)?(?P<module>[^/]+)/(?P<path>.*)$', generic.static_media, name='sentry-media'), # API url(r'^api/0/', include('sentry.api.urls')), url(r'^api/hooks/mailgun/inbound/', MailgunInboundWebhookView.as_view(), name='sentry-mailgun-inbound-hook'), url(r'^api/hooks/release/(?P<plugin_id>[^/]+)/(?P<project_id>[^/]+)/(?P<signature>[^/]+)/', ReleaseWebhookView.as_view(), name='sentry-release-hook'), url(r'^api/embed/error-page/$', ErrorPageEmbedView.as_view(), name='sentry-error-page-embed'), # Auth url(r'^auth/link/(?P<organization_slug>[^/]+)/$', AuthOrganizationLoginView.as_view(), name='sentry-auth-link-identity'), url(r'^auth/login/$', AuthLoginView.as_view(), name='sentry-login'), url(r'^auth/login/(?P<organization_slug>[^/]+)/$', AuthOrganizationLoginView.as_view(), name='sentry-auth-organization'), url(r'^auth/2fa/$', TwoFactorAuthView.as_view(), name='sentry-2fa-dialog'), url(r'^auth/2fa/u2fappid\.json$', u2f_appid, name='sentry-u2f-app-id'), url(r'^auth/sso/$', AuthProviderLoginView.as_view(), name='sentry-auth-sso'), url(r'^auth/logout/$', AuthLogoutView.as_view(), name='sentry-logout'), url(r'^auth/reactivate/$', ReactivateAccountView.as_view(), name='sentry-reactivate-account'),