@@ -82,6 +82,11 @@ def is_valid(self, request_data, request_id=None):
8282 idp_entity_id = idp_data ['entityId' ]
8383 get_data = request_data ['get_data' ]
8484
85+ if 'lowercase_urlencoding' in request_data .keys ():
86+ lowercase_urlencoding = request_data ['lowercase_urlencoding' ]
87+ else :
88+ lowercase_urlencoding = False
89+
8590 if self .__settings .is_strict ():
8691 res = OneLogin_Saml2_Utils .validate_xml (self .document , 'saml-schema-protocol-2.0.xsd' , self .__settings .is_debug_active ())
8792 if not isinstance (res , Document ):
@@ -119,10 +124,10 @@ def is_valid(self, request_data, request_id=None):
119124 else :
120125 sign_alg = get_data ['SigAlg' ]
121126
122- signed_query = 'SAMLResponse=%s' % OneLogin_Saml2_Utils .get_encoded_parameter (get_data , 'SAMLResponse' )
127+ signed_query = 'SAMLResponse=%s' % OneLogin_Saml2_Utils .get_encoded_parameter (get_data , 'SAMLResponse' , lowercase_urlencoding = lowercase_urlencoding )
123128 if 'RelayState' in get_data :
124- signed_query = '%s&RelayState=%s' % (signed_query , OneLogin_Saml2_Utils .get_encoded_parameter (get_data , 'RelayState' ))
125- signed_query = '%s&SigAlg=%s' % (signed_query , OneLogin_Saml2_Utils .get_encoded_parameter (get_data , 'SigAlg' , OneLogin_Saml2_Constants .RSA_SHA1 ))
129+ signed_query = '%s&RelayState=%s' % (signed_query , OneLogin_Saml2_Utils .get_encoded_parameter (get_data , 'RelayState' , lowercase_urlencoding = lowercase_urlencoding ))
130+ signed_query = '%s&SigAlg=%s' % (signed_query , OneLogin_Saml2_Utils .get_encoded_parameter (get_data , 'SigAlg' , OneLogin_Saml2_Constants .RSA_SHA1 , lowercase_urlencoding = lowercase_urlencoding ))
126131
127132 if 'x509cert' not in idp_data or idp_data ['x509cert' ] is None :
128133 raise Exception ('In order to validate the sign on the Logout Response, the x509cert of the IdP is required' )
0 commit comments