-
-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
settings parser throws "idp cert not found" exception #392
Comments
The check_idp_settings method checks that the settings dict provided are ok. As no 'x509cert' is inside the dict, is expected that this raises an error. Can you describe how are you getting the |
I use Flask-Multipass as a wrapper. For SAML it just maps the config through. I understand that the Edit: The SP certs are checked with Here is the full stacktrace, just in case:
|
oh ok, now I see your proposal, so having something like:
Can you create the PR and maybe add some tests? |
Sure, I`ll see what I can do. |
In order to add a test with and without a certificate present in the |
The tests folder of the repo already has a certs folder there, you can add the idp.crt file there. Be able to customize the name of the cert file I believe will add extra complexity to the code of the project. |
Edit: only now I realise that |
Hi everyone,
I just found a potential issue in the configuration check that causes a
OneLogin_Saml2_Error
Exception with the messageidp_cert_or_fingerprint_not_found_and_required
.As with many other programs I wan't to keep my certificate files in a special folder on my server. Therefor I left the x509 cert and key fields in the SP and IDP config part empty and provided a
custom_base_path
. The SP cert and key are loaded correctly from the file, just the configuration check for the IDP config is failing.How to reproduce:
custom_base_path
in the configsp.crt
,sp.key
,idp.crt
) in acerts
folder in the base pathsignMetadata
to TrueSuggested Fix
I identified this line of code as the root cause of the issue, as it only checks for an x509 cert in the IDP config, but not in the file.
python3-saml/src/onelogin/saml2/settings.py
Line 392 in a1211a8
My Suggestion would be to use the native function in order to check both the configuration and a potential cert file.
exists_x509 = bool(self.get_idp_cert())
If this is considered as an issue that needs to be fixed I'll be happy to open a pull request.
The text was updated successfully, but these errors were encountered: