Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
r350178982 committed May 25, 2024
1 parent d17ca4e commit bfb311f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions seahub/adfs_auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
2 changes: 2 additions & 0 deletions seahub/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,8 @@
re_path(r'^org/custom/(?P<org_id>\d+)/saml2/metadata/$', metadata, name='org_saml2_metadata'),
re_path(r'^org/custom/(?P<org_id>\d+)/saml2/connect/$', saml2_connect, name='org_saml2_connect'),
re_path(r'^org/custom/(?P<org_id>\d+)/saml2/disconnect/$', saml2_disconnect, name='org_saml2_disconnect'),
re_path(r'^org/custom/(?P<org_id>\d+)/saml2/ls/$', SamlLogoutView.as_view(), name='org_saml2_ls'),
re_path(r'^org/custom/(?P<org_id>\d+)/saml2/ls/post/$', SamlLogoutView.as_view(), name='org_saml2_ls_post'),
re_path(r'^org/custom/(?P<org_id>\d+)/saml2/', include(('djangosaml2.urls', 'djangosaml2'), namespace='org')),
re_path(r'^org/custom/(?P<url_prefix>[a-z_0-9-]+)/saml2/login/$', adfs_compatible_view, name='login_compatible_view'),
re_path(r'^org/custom/(?P<url_prefix>[a-z_0-9-]+)/saml2/acs/$', adfs_compatible_view, name='acs_compatible_view'),
Expand Down

0 comments on commit bfb311f

Please sign in to comment.