-
Notifications
You must be signed in to change notification settings - Fork 441
Signed SSO with HTTP-REDIRECT Binding [was: cert field not read?] #713
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
Comments
Hi, is that remote endpoint under https and probably without a valid certificate. Something like:
This example is available in djangosaml2 README. |
@peppelinux Hi, the remote endpoint is under https and does have a valid certificate. What I am curios of is that it is never complaining of the contents in the field - if I enter a file that does not exist, a file that does exist, or anything - nothing produces a warning such as "can't find file" or similar - as happens if I enter a wrong location for e.g. "key_file" and "cert_file". So I am a bit confused of what to actually put in the "cert" field? |
That cert would be needed to verify metadata signature. If that's not signed that parameter Is useless |
Follow It with a breakpoint() here Line 770 in 1aeae3a
You'll see what happens |
@peppelinux Okay thanks. The thing is I am getting:
It is all working with a local IDP server, but when we try to connect to PingfederateIDP it is not. IDP initiated login works fine, but SP initiated logins generate above error message as long as Any ideas? |
Yes, we completely went out of route 😎 In federations we do not use to sign requests, that's to prevent resource consuming with signature validation (DoS) but if you want It use http-post with pysaml2 and It will work Please update metadata as well |
@peppelinux yes :) Hmm okay, so settings are:
Still generates the same error. Am I missing something? :) |
The question is, are you using djangosaml2? (I see settings.stuffs) Probably your IdP wants autn request signed in http-redirect? Give us the url of the idp metadata, I'll take a look. It would be the time to face this definitively, with a smart code refactor as well |
@peppelinux Yes, correct - the IdP needs authn request signed in http-redirect I am not using djangosaml2 but only pysaml2. IDP metadata:
So it seems like the signature must be appended to the request as a query parameter, am I right? Do you have any idea how this can be done? :) |
I would dig to get this working but I see:
Ok, get your SP to make authn request via POST and everything will works great. Digging more on http-redirect, it would be: See "3.4.8 Example SAML Message Exchange Using HTTP Redirect" in https://docs.oasis-open.org/security/saml/v2.0/saml-bindings-2.0-os.pdf now we have to check if pysaml2 works fine with this specification in http-redirect signed binding ... going further ... |
@peppelinux Yeah, they say "all their other SP's use GET" so they think we should too. Exactly, it seems like it should be like: ?SAMLRequest={val1}&Signature={val2}&SigAlg={val3} with the Signature and SigAlg as query params. Can pysaml2 do this? Or is it us doing something wrong? It feels like this is a very common scenario - someone must have reached this error before? Thanks a lot for digging into this!! |
And yes, I configured uniauth (a fairly unknow saml2 idp based on pysaml2) with http-redirect only and mandatory signed requests.
And this helped me to get the decision to patch this definitely in djangosaml2. The only ugliness but entirely relative is that the signature now appears both in url args and request.body (post). Now I have
|
Can you see the http-redirect url with the signature in it? |
Yes, pysaml2 does it in the right way, see your SP implementation. This should be similar to djangosaml2 login initialization, so you would find there an example implementation. And, at last but not least, the IdP's metadata doesn't show the supported algs. Does it support sha1 for signatures? |
@peppelinux One strange thing is that when I do: The generated URL has no Signature nor sigalg query param. Do you have any idea why? |
just have this as reference: it simply works |
@peppelinux Right, got it working now. Thanks for all your support! ❤️ |
I think this is actually a bug that we should fix. @peppelinux thanks for the support ;) 👍 |
Hi @c00kiemon5ter, not so bad, I wouldn't see this as a bug, the only ugliness is that the signature now appears both in url args and request.body (post). But it works. The bug would instead with a pysaml2 IdP and Shibboleth SP. ShibSP doesn't put signature also in saml2 request (but only in http-redirect url arg, as it would have to be). So pysaml2 IdP rejects the authn request because it can't find the signature in Saml2. |
This is now fixed by 2f756ba |
Hi,
Using pysaml2 as an SP, any my metadata is:
'metadata': { 'remote': [ { "url": a-remote-url "cert": a-file }, ] },
The thing is that it feels like the cert field is not being used - I can have any value here (a string, a file, a file that does not exist) and it does not affect the workflow at all. Does this field not work when the remote host is localhost?
Code Version
6.1.0
Expected Behavior
Read the value of the cert field
Current Behavior
Any value of the cert field works
The text was updated successfully, but these errors were encountered: