java - Validate IDP initiated SAML2.0 Response -
saml experts please help!!!!
am new saml , jsp. wanna validate idp(identity provider) initiated saml response token using opensaml library in java(environment linux,tomcat6.0) , retrieve attribute information sent such userid,username,email.the saml response not encrypted , have idp's trust certificate installed in java keystore.the saml token profile "web browser sso" , uses http-post binding.the certificate has public key in it.do need private key validate?what steps done succesful validation?just digital signature validation enough trust source?should profile validation or else? below given saml response receiving idp. please let me know if need more information?sorry if did not give enough information.please me...thanks in advance.
<samlp:response xmlns:samlp="urn:oasis:names:tc:saml:2.0:protocol" id="xyz" version="2.0" issueinstant="2013-07-10t16:43:54z" destination="http://www.testsp.com"> <saml:issuer xmlns:saml="urn:oasis:names:tc:saml:2.0:assertion">http://www.testidp.com:8080/opensso</saml:issuer> - <samlp:status xmlns:samlp="urn:oasis:names:tc:saml:2.0:protocol"> <samlp:statuscode xmlns:samlp="urn:oasis:names:tc:saml:2.0:protocol" value="urn:oasis:names:tc:saml:2.0:status:success" /> </samlp:status> - <saml:assertion xmlns:saml="urn:oasis:names:tc:saml:2.0:assertion" id="xyz" issueinstant="2013-07-10t16:43:51z" version="2.0"> <saml:issuer>http://www.testidp.com:8080/opensso</saml:issuer> - <ds:signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> - <ds:signedinfo> <ds:canonicalizationmethod algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> <ds:signaturemethod algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> - <ds:reference uri="#xyz"> - <ds:transforms> <ds:transform algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /> <ds:transform algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> </ds:transforms> <ds:digestmethod algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> <ds:digestvalue>...hdfb3454jh545dfbj545423df....=</ds:digestvalue> </ds:reference> </ds:signedinfo> <ds:signaturevalue>..................hsdgysgdyyusgfdfb98738e43hjrg874y474h7y8r............=</ds:signaturevalue> - <ds:keyinfo> - <ds:x509data> <ds:x509certificate>............./kpm0qlp8vcohyi76aue6jl nfetlcae3b6hodfkciu+ethezc2i/8jf1rhdnpey4ts1mqj/....... </ds:x509certificate> </ds:x509data> </ds:keyinfo> </ds:signature> - <saml:subject> <saml:nameid format="urn:oasis:names:tc:saml:2.0:nameid-format:transient" namequalifier="http://www.testidp.com:8080/opensso" spnamequalifier="http://www.testsp.com">....zeq8nhjkrkdxuwx67ytuynwj4n...</saml:nameid> - <saml:subjectconfirmation method="urn:oasis:names:tc:saml:2.0:cm:bearer"> <saml:subjectconfirmationdata notonorafter="2013-07-10t16:53:51z" recipient="http://www.testsaml.com/tespsamlmodule" /> </saml:subjectconfirmation> </saml:subject> - <saml:conditions notbefore="2013-07-10t16:33:51z" notonorafter="2013-07-10t16:53:51z"> - <saml:audiencerestriction> <saml:audience>http://www.testsaml.com/tespsamlmodule</saml:audience> </saml:audiencerestriction> </saml:conditions> - <saml:authnstatement authninstant="2013-07-10t16:36:35z" sessionindex="......erer54t54y45y75666y65y65y...."> - <saml:authncontext> <saml:authncontextclassref>urn:oasis:names:tc:saml:2.0:ac:classes:passwordprotectedtransport</saml:authncontextclassref> </saml:authncontext> </saml:authnstatement> - <saml:attributestatement> - <saml:attribute name="uid"> <saml:attributevalue xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:type="xs:string">ab123</saml:attributevalue> </saml:attribute> - <saml:attribute name="uname"> <saml:attributevalue xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:type="xs:string">robert</saml:attributevalue> </saml:attribute> - <saml:attribute name="emailaddress"> <saml:attributevalue xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:type="xs:string">robert@example.com</saml:attributevalue> </saml:attribute> </saml:attributestatement> </saml:assertion> </samlp:response>
you need validate responce according saml spec. there functionaliy doing in opensaml seems safest bet write own validation code. see. http://marc.info/?t=137354098500007&r=1&w=2
you must validate signature. signature verification use public key. here wrote on blog opensaml signatur verification. http://mylifewithjava.blogspot.no/2012/11/verifying-signatures-with-opensaml.html
i have more on signing , encryption using opensaml in book, a guide opensaml
Comments
Post a Comment