-
Notifications
You must be signed in to change notification settings - Fork 38
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
signing, decryption, and relay state HMAC-SHA1 for service providers #4
Conversation
A demo SP is provided in dev/demo_sp.clj. This version adds the following: - Validate the signature of the IdP responses - Decryption of the IdP supplied assertions - Creation of SAML Metadata - SP related 'routes', check the saml20-clj/routes.clj file Please keep in mind that in order to use it you need to create a private and public key pair and store them in a Java keystore file (use the 'keytool').
the SP interoperates successfully with the testshib (https://www.testshib.org) IdP (found at https://idp.testshib.org/)
According to the SAML Bindings specification "RelayState data MAY be included with a SAML protocol message" transmitted with the HTTP-Redirect binding. But "because the value is exposed to third-party tampering, the entity SHOULD ensure that the value has not been tampered with by using a checksum, a pseudo-random value, or similar means". In the current implementation we create a "secret key" on starutp that is later on used to create a keyed-hash message authentication code (HMAC) using SHA-1 as the secure hash algorithm. What is currently hashed is the "continue-url" information, to produce the following as relay state: <continue-url>:<hmac-sha1(continue-url, secret-key)> On the arrival of the response the relay state data is again validated and if the continue-url does not match its hashed value the response is rejected.
Set the canonicalizer declaration in the signature as well
signing, decryption, and relay state HMAC-SHA1 for service providers
Sorry it took a while to get back to this, I haven't really been working on this library. I may be updating parts of this because this was one of my first Clojure projects and I think that a little bit of clean-up is in order. |
@sgsfak This is in Clojars now with the version I bumped versions and change some dep ordering to keep versions playing nicely as well. |
Thanks Jon, I will test it when time permits |
No description provided.