Fixed SAMLResponse conversion under some circunstances

This commit is contained in:
Adolfo Gómez García 2022-03-02 15:51:59 +01:00
parent 0e257c779b
commit 2b6193a1ec

View File

@ -484,7 +484,10 @@ class SAMLAuthenticator(auths.Authenticator):
# Convert HTTP-POST to HTTP-REDIRECT on SAMLResponse, for just in case... # Convert HTTP-POST to HTTP-REDIRECT on SAMLResponse, for just in case...
if 'SAMLResponse' in req['post_data']: if 'SAMLResponse' in req['post_data']:
req['get_data']['SAMLResponse'] = req['post_data']['SAMLResponse'] if isinstance(req['post_data']['SAMLResponse'], list):
req['get_data']['SAMLResponse'] = req['post_data']['SAMLResponse'][0]
else:
req['get_data']['SAMLResponse'] = req['post_data']['SAMLResponse']
settings = OneLogin_Saml2_Settings(settings=self.oneLoginSettings()) settings = OneLogin_Saml2_Settings(settings=self.oneLoginSettings())
auth = OneLogin_Saml2_Auth(req, settings) auth = OneLogin_Saml2_Auth(req, settings)