fix(chalice): fixed SSO (#1920)

This commit is contained in:
Kraiem Taha Yassine 2024-02-29 17:19:09 +01:00 committed by GitHub
parent be717cd01a
commit fa91609d8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,8 +35,17 @@ async def process_sso_assertion(request: Request):
session = req["cookie"]["session"]
auth = init_saml_auth(req)
redirect_to_link2 = json.loads(req.get("post_data", {}) \
.get('RelayState', '{}')).get("iFrame")
post_data = req.get("post_data")
if post_data is None:
post_data = {}
elif isinstance(post_data, str):
post_data = json.loads(post_data)
elif not isinstance(post_data, dict):
logger.error("Received invalid post_data")
logger.error("type: {}".format(type(post_data)))
logger.error(post_data)
redirect_to_link2 = post_data.get('RelayState', {}).get("iFrame")
request_id = None
if 'AuthNRequestID' in session:
request_id = session['AuthNRequestID']