Closed Lapeth closed 1 year ago
Hi @Lapeth,
have you solved this issue? otherwise, are you still interested in solving this issue?
Check this thread: https://github.com/xmlsec/python-xmlsec/issues/22
You can try to use this simple script to check if the issue is on xmlsec or python3-saml.
Reopen this ticket in case that the issue is on python3-saml side.
I ended up using PySaml2 instead. That was a bumpy road as well, but eventually I got it working.
(Also raised this on StackOverflow a couple of days ago)
I've run into an issue with python3-saml where the AuthResponse fails to get decrypted. This is with a SP cert/key pair that I know fit together, and a test with these against a local SimpleSamlPHP container works fine. The certificate and key have been provided by the IdP for testing purposes here, so they're not used in production systems.
With debugging enabled, the following is logged:
Example SAML Response that triggers this:
Note that the IdP uses RSA-OAEP in the response, and that one of the log lines mentions this algorithm.
I've tried patching utils.py, in the method
decrypt_element
, in order to inspect the key being added and generally to analyze the problem, and found that even though the key is added through anxmlsec.KeysManager
,enc_ctx.key
is None afterwards. Setting it withenc_ctx.key = xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None)
gets rid of the first several errors, but doesn't solve the problem (plus I know patching the code myself wouldn't be a solution anyway).Does xmlsec have a problem with RSA-OAEP, or does python3-saml need to register the algorithm somehow?