Please see the following implementation of SAMLhttp://www.jasig.org/cashttp://www.ja-sig.org/wiki/display/CAS/Shawn+CAS+and+SAML