Exemple #1
0
 path('admin/', admin.site.urls),
 path('admin/report/', staff_member_required(ReportView.as_view())),
 path('api-tokens/', get_api_tokens_view),
 path('accounts/profile/', show_login),
 path('accounts/login/', LoginView.as_view()),
 path('accounts/logout/', LogoutView.as_view()),
 path('accounts/', include(auth_backends.urls, namespace='auth_backends')),
 path('accounts/', include(social_auth_urls, namespace='social')),
 path('oauth2/applications/', permission_denied),
 path('oauth2/authorize/',
      TunnistamoAuthorizationView.as_view(),
      name="oauth2_authorize"),
 path('oauth2/', include(oauth2_provider.urls,
                         namespace='oauth2_provider')),
 re_path(r'^openid/authorize/?$',
         TunnistamoOidcAuthorizeView.as_view(),
         name='authorize'),
 re_path(r'^openid/end-session/?$',
         TunnistamoOidcEndSessionView.as_view(),
         name='end-session'),
 re_path(r'^openid/token/?$',
         csrf_exempt(TunnistamoOidcTokenView.as_view()),
         name='token'),
 path('openid/', include(oidc_provider.urls, namespace='oidc_provider')),
 re_path(r'^\.well-known/openid-configuration/?$',
         OIDCProviderInfoView.as_view(),
         name='root-provider-info'),
 re_path(r'^user/(?P<username>[\w.@+-]+)/?$', UserView.as_view()),
 path('user/', UserView.as_view()),
 path('jwt-token/', GetJWTView.as_view()),
 path('login/', LoginView.as_view()),
Exemple #2
0
def test_tunnistamo_authorize_view_is_used(client, with_trailing_slash):
    response = client.get(
        '/openid/authorize{}'.format('/' if with_trailing_slash else ''))
    assert response.resolver_match.func.__name__ == TunnistamoOidcAuthorizeView.as_view(
    ).__name__
Exemple #3
0
v1_scope_path = path('scope/', ScopeListView.as_view(), name='scope-list')
v1_api_path = path('v1/', include((router.urls + [v1_scope_path], 'v1')))

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api-tokens/', get_api_tokens_view),
    path('accounts/profile/', show_login),
    path('accounts/login/', LoginView.as_view()),
    path('accounts/logout/', LogoutView.as_view()),
    path('accounts/', include(auth_backends.urls, namespace='auth_backends')),
    path('accounts/', include(social_auth_urls, namespace='social')),
    path('oauth2/applications/', permission_denied),
    path('oauth2/authorize/', TunnistamoAuthorizationView.as_view(), name="oauth2_authorize"),
    path('oauth2/', include(oauth2_provider.urls, namespace='oauth2_provider')),
    re_path(r'^openid/authorize/?$', TunnistamoOidcAuthorizeView.as_view(), name='authorize'),
    re_path(r'^openid/end-session/?$', TunnistamoOidcEndSessionView.as_view(), name='end-session'),
    path('openid/', include(oidc_provider.urls, namespace='oidc_provider')),
    re_path(r'^\.well-known/openid-configuration/?$', OIDCProviderInfoView.as_view(), name='root-provider-info'),
    re_path(r'^user/(?P<username>[\w.@+-]+)/?$', UserView.as_view()),
    path('user/', UserView.as_view()),
    path('jwt-token/', GetJWTView.as_view()),
    path('login/', LoginView.as_view()),
    path('logout/', LogoutView.as_view()),
    path('email-needed/', EmailNeededView.as_view(), name='email_needed'),
    v1_api_path,
    path('docs/', include_docs_urls(title='Tunnistamo API v1', patterns=[v1_api_path],
                                    generator_class=AllEnglishSchemaGenerator)),
]

if settings.DEBUG:
Exemple #4
0
v1_api_path = path('v1/', include((router.urls + [v1_scope_path], 'v1')))


urlpatterns = [
    path('admin/', admin.site.urls),
    path('admin/report/', staff_member_required(ReportView.as_view())),
    path('api-tokens/', get_api_tokens_view),
    path('accounts/profile/', show_login),
    path('accounts/login/', LoginView.as_view()),
    path('accounts/logout/', AuthoritativeLogoutRedirectView.as_view()),
    path('accounts/', include(auth_backends.urls, namespace='auth_backends')),
    path('accounts/', include(social_auth_urls, namespace='social')),
    path('oauth2/applications/', permission_denied),
    path('oauth2/authorize/', TunnistamoAuthorizationView.as_view(), name="oauth2_authorize"),
    path('oauth2/', include(oauth2_provider.urls, namespace='oauth2_provider')),
    re_path(r'^openid/authorize/?$', TunnistamoOidcAuthorizeView.as_view(), name='authorize'),
    re_path(r'^openid/end-session/?$', TunnistamoOidcEndSessionView.as_view(), name='end-session'),
    re_path(r'^openid/token/?$', csrf_exempt(TunnistamoOidcTokenView.as_view()), name='token'),
    path('openid/', include(oidc_provider.urls, namespace='oidc_provider')),
    re_path(r'^\.well-known/openid-configuration/?$', OIDCProviderInfoView.as_view(), name='root-provider-info'),
    re_path(r'^user/(?P<username>[\w.@+-]+)/?$', UserView.as_view()),
    path('user/', UserView.as_view()),
    path('jwt-token/', GetJWTView.as_view()),
    path('login/', LoginView.as_view()),
    path('logout/', AuthoritativeLogoutRedirectView.as_view()),
    v1_api_path,
    path('docs/', include_docs_urls(title='Tunnistamo API v1', patterns=[v1_api_path],
                                    generator_class=AllEnglishSchemaGenerator)),
]

if settings.DEBUG:
def test_tunnistamo_authorize_view_is_used(client, with_trailing_slash):
    response = client.get('/openid/authorize{}'.format('/' if with_trailing_slash else ''))
    assert response.resolver_match.func.__name__ == TunnistamoOidcAuthorizeView.as_view().__name__