-
Notifications
You must be signed in to change notification settings - Fork 400
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
Auth.processSLO() should fast-fail on non-GET requests #299
Comments
samltool.com uses the php-saml toolkit as base, not java-saml, and the validate_logout_res.php endpoint accepts the XML but not the base64encoded form, you can just decode it with https://www.samltool.com/decode.php. At java-saml, the method to validate the Signature of HTTP-Redirect bindings is validateBinarySignature The parameters are retrieved using request.getEncodedParameter unless the signature which is retrieved first with request.getParameter("Signature"); and later decoded with Util.base64decoder that executes
Based on its documentation, the Base64 class provides Base64 encoding and decoding as defined by RFC 2045. The getEncodedParameter uses Utils.urlEncoder uses The SAML standard specifies how sign on the HTTP-Redirect binding protocol at
|
@pitbulk Thank you for your patience, Sixto. I was apparently using HTTP Post bindings, where I should have been using HTTP Redirect bindings. |
On the other hand, would it be an improvement if bindings type was checked before the rest of the validation started, so this is easier to figure out? |
java-saml generates and receives all SAML messages by the HTTP-Redirect binding with the exception of the SAMLResponse received via HTTP-POST. |
But how can the SP side control which bindings it wants? In my case I'm the SP, and after sending a logout request, the logout response was received as an HTTP Post binding, simply because IDP decided so. But then it's just a mock IDP, so it's not following a whole lot of rules. I've changed it to use HTTP Redirect and that fixed things, but it would have been a lot easier to realize what's wrong if the response processing code checked the binding and threw an error before going into signature check. |
SP exposes SAML metadata where are defined the endpoints and its associated binding. I wonder why you have not experienced the error defined here:
which is exactly the error that you wanted to receive instead the signature validation error. |
That's fair. But yes, I was dealing with Mujina, which I then hacked myself, no SP metadata, so no wonder I stepped into this.
That's what I was talking about. Using |
Oh I see, I think in the past this kind of error was raised...but when the httpRequest class was added, we missed it. |
Auth.processSLO()
should fast-fail on non-GET requests
Auth.processSLO()
should fast-fail on non-GET requests
Yes, let me. |
Signatures generated for logout response in opensaml (2.6.6) can not be validated by java-saml.
I'm still in the process of investigating this, and not really sure who to blame.
The reason for signature mismatch is that Opensaml puts the original message contents into the signing buffer, and java-saml uses base64 encoded version of it. It actually seems to use percent-encoded base64 encoded message.
However, I also could not validate the message using https://www.samltool.com/validate_logout_res.php. Interestingly, the latter doesn't accept base64 logout response contents.
I also can't find where is this described in SAML documentation. That documentation only talks about XML signatures, which whatever is being used here is not.
I'm loaded with questions, though:
The text was updated successfully, but these errors were encountered: