15
2006
Implementing SAML 2.0 on the cheap…
This last year I’ve done more SAML than any man should. I’ve had a couple of clients doing federated identity and single signon stuff, and SAML is all the rage (actually, I’ve found it pretty great to work with once I got my head around XML C14N).
SAML 2.0 is new and shiny and vendors are still scrabling to build libraries to handle it, so to test interop, I built a little test harness. Originally it just used strings for the messages, but some of the messages are so verbose (with just the odd timestamp or url insertion here or there), it was time to make the switch to a templating language before escaping quote characters inside strings drove me crazy.
I’ve been meaning to play with Freemarker for a while, but I finally had a good excuse. I’ve tinkered with Velocity before, so the paradigm was familiar, but one thing I really like about Freemarker is how it can handle its context being a plain vanilla java.util.Map. It also crashes and burns if you don’t provide a value for one of the merge strings in the template (which for me is a good thing, though in the web context it might not be so sweet).
For doing the actual message signing, you can’t go past Apache XML Security. I’ve raved about it before, but it is just sensational. Spec complete, and very easy to work with.
So my little test harness scoops up one of my canned templates, merges in some timestamps and urls, output it all as a string, sends it to XML Security for the signatures, then ships it off to the big hairy vendor for validation. It also slurps in responses from the other end, validates the signature, and gives you feelgood output.
In the end I’ve got a pretty cool little interop app that I can validate a good subset of SAML 2.0 against the big iron. On the very cheap…
Great work Freemarker and XML Security dudes. Your libraries are awesome!
1 Comment + Add Comment
Leave a comment
Glen Smith
Archives
- April 2012
- March 2012
- January 2012
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- April 2011
- March 2011
- January 2011
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
- April 2005
- March 2005
- February 2005
- January 2005
- December 2004
- November 2004
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- March 2004
- February 2004
- January 2004
- December 2003
- November 2003
- October 2003
- September 2003

An article by Glen





Hi Glen,
I really got happy when I found your post “Implementing SAML…”, because now I have trouble working with this protocol. So my job as a software developer is to learn SAML and to integrate with idP and SP’s. Can you help me with your “pretty cool little interop app” ? I would appreciate if you could give me some detailed description, step-by-step guide and finally if not too much a sample freemaker application.
Thank you