From 5c55bd10ed825651a4f035cdf50fe7095b3b1826 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Thu, 2 Dec 2021 16:25:54 +0100 Subject: [PATCH] feat(api): SAML helper add /api to script_name --- ee/api/chalicelib/utils/SAML2_helper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ee/api/chalicelib/utils/SAML2_helper.py b/ee/api/chalicelib/utils/SAML2_helper.py index eb5244d7c..43b6c6bc7 100644 --- a/ee/api/chalicelib/utils/SAML2_helper.py +++ b/ee/api/chalicelib/utils/SAML2_helper.py @@ -9,13 +9,13 @@ SAML2 = { "strict": True, "debug": True, "sp": { - "entityId": environ["SITE_URL"] + "/sso/saml2/metadata/", + "entityId": environ["SITE_URL"] + "/api/sso/saml2/metadata/", "assertionConsumerService": { - "url": environ["SITE_URL"] + "/sso/saml2/acs", + "url": environ["SITE_URL"] + "/api/sso/saml2/acs", "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" }, "singleLogoutService": { - "url": environ["SITE_URL"] + "/sso/saml2/sls", + "url": environ["SITE_URL"] + "/api/sso/saml2/sls", "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" }, "NameIDFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", @@ -90,7 +90,7 @@ def prepare_request(request): 'https': 'on' if request.headers.get('x-forwarded-proto', 'http') == 'https' else 'off', 'http_host': request.headers['host'], 'server_port': url_data.port, - 'script_name': request.path, + 'script_name': "/api"+request.path, 'get_data': request.args.copy(), # Uncomment if using ADFS as IdP, https://github.com/onelogin/python-saml/pull/144 # 'lowercase_urlencoding': True,