To implement the SAML 2.0 protocol (or the Liberty Alliance protocols) in a web application, Lasso is the solution.
Lasso is a free library supporting the SAML 2.0, ID-FF 1.2 and ID-WSF identity federation standards. Lasso has been certified conform to the SAML 2.0 specifications by the Liberty Alliance consortium (now Kantara Initiative) in 2006.
Lasso is written in C, which guarantees a high level of performance, but has bindings (higher layer) for Java, Perl, PHP and Python languages.
To learn more about it, consult the Lasso dedicated website.