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,6 +484,9 @@ 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']:
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'] req['get_data']['SAMLResponse'] = req['post_data']['SAMLResponse']
settings = OneLogin_Saml2_Settings(settings=self.oneLoginSettings()) settings = OneLogin_Saml2_Settings(settings=self.oneLoginSettings())