feat(api): SAML helper add /api to script_name

This commit is contained in:
Taha Yassine Kraiem 2021-12-02 16:25:54 +01:00
parent b38d940ed0
commit 5c55bd10ed

View file

@ -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,