diff --git a/seahub/adfs_auth/views.py b/seahub/adfs_auth/views.py index 1edbc25ee2b..bd5fdc1422f 100644 --- a/seahub/adfs_auth/views.py +++ b/seahub/adfs_auth/views.py @@ -29,6 +29,7 @@ from saml2.metadata import entity_descriptor from djangosaml2.cache import IdentityCache, OutstandingQueriesCache from djangosaml2.conf import get_config +from djangosaml2.views import LogoutView from seaserv import ccnet_api, seafile_api @@ -562,3 +563,7 @@ def adfs_compatible_view(request, url_prefix): org_id = str(org.org_id) return HttpResponsePermanentRedirect(request.path.replace(url_prefix, org_id)) + +class SamlLogoutView(LogoutView): + def do_logout_service(self, request, data, binding, *args, **kwargs): + return super(SamlLogoutView, self).do_logout_service(request, data, binding) diff --git a/seahub/urls.py b/seahub/urls.py index 69f658904e9..065416746bb 100644 --- a/seahub/urls.py +++ b/seahub/urls.py @@ -930,6 +930,8 @@ re_path(r'^org/custom/(?P\d+)/saml2/metadata/$', metadata, name='org_saml2_metadata'), re_path(r'^org/custom/(?P\d+)/saml2/connect/$', saml2_connect, name='org_saml2_connect'), re_path(r'^org/custom/(?P\d+)/saml2/disconnect/$', saml2_disconnect, name='org_saml2_disconnect'), + re_path(r'^org/custom/(?P\d+)/saml2/ls/$', SamlLogoutView.as_view(), name='org_saml2_ls'), + re_path(r'^org/custom/(?P\d+)/saml2/ls/post/$', SamlLogoutView.as_view(), name='org_saml2_ls_post'), re_path(r'^org/custom/(?P\d+)/saml2/', include(('djangosaml2.urls', 'djangosaml2'), namespace='org')), re_path(r'^org/custom/(?P[a-z_0-9-]+)/saml2/login/$', adfs_compatible_view, name='login_compatible_view'), re_path(r'^org/custom/(?P[a-z_0-9-]+)/saml2/acs/$', adfs_compatible_view, name='acs_compatible_view'),