diff --git a/server/src/uds/auths/SAML/saml.py b/server/src/uds/auths/SAML/saml.py index 67cc846ca..8c911f440 100644 --- a/server/src/uds/auths/SAML/saml.py +++ b/server/src/uds/auths/SAML/saml.py @@ -30,9 +30,8 @@ """ .. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com """ -from cProfile import label -from json import tool import re +from urllib.parse import urlparse import xml.sax import requests import logging @@ -304,12 +303,14 @@ class SAMLAuthenticator(auths.Authenticator): request: 'ExtendedHttpRequest', params: typing.Dict[str, typing.Any] = {}, ) -> typing.Dict[str, typing.Any]: + manageUrlObj = urlparse(self.manageUrl.value) + script_path = manageUrlObj.path # If callback parameters are passed, we use them if params: return { 'https': ['off', 'on'][params.get('https', False)], 'http_host': params['http_host'], - 'script_name': self.manageUrl.value, # params['path_info'], + 'script_name': script_path, # params['path_info'], 'server_port': params['server_port'], 'get_data': params['get_data'].copy(), 'post_data': params['post_data'].copy(), @@ -320,7 +321,7 @@ class SAMLAuthenticator(auths.Authenticator): return { 'https': 'on' if request.is_secure() else 'off', 'http_host': request.META['HTTP_HOST'], - 'script_name': self.manageUrl.value, # request.META['PATH_INFO'], + 'script_name': script_path, # request.META['PATH_INFO'], 'server_port': request.META['SERVER_PORT'], 'get_data': request.GET.copy(), 'post_data': request.POST.copy(),