X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=samltest%2Fsaml1%2Fbinding%2FSAML1POSTTest.h;h=9750b3d28b28b79e0684f3ef38f54b860f26de2f;hb=a0323c50525a6ff43795da2dc786e5aeaf726d41;hp=eb8278c21cbb8daa347681a1801a2afe7603bc81;hpb=d2160d2eb960f57e06f96aa3ef1bf80e56a0b4b6;p=shibboleth%2Fopensaml2.git diff --git a/samltest/saml1/binding/SAML1POSTTest.h b/samltest/saml1/binding/SAML1POSTTest.h index eb8278c..9750b3d 100644 --- a/samltest/saml1/binding/SAML1POSTTest.h +++ b/samltest/saml1/binding/SAML1POSTTest.h @@ -34,7 +34,8 @@ public: void testSAML1POST() { try { QName idprole(samlconstants::SAML20MD_NS, IDPSSODescriptor::LOCAL_NAME); - SecurityPolicy policy(m_rules1, m_metadata, &idprole, m_trust, false); + SecurityPolicy policy(m_metadata, &idprole, m_trust, false); + policy.getRules().assign(m_rules1.begin(), m_rules1.end()); // Read message to use from file. string path = data_path + "saml1/binding/SAML1Response.xml"; @@ -46,11 +47,11 @@ public: ); janitor.release(); - CredentialCriteria cc; - cc.setUsage(CredentialCriteria::SIGNING_CREDENTIAL); - Locker clocker(m_creds); - const Credential* cred = m_creds->resolve(&cc); - TSM_ASSERT("Retrieved credential was null", cred!=NULL); + CredentialCriteria cc; + cc.setUsage(CredentialCriteria::SIGNING_CREDENTIAL); + Locker clocker(m_creds); + const Credential* cred = m_creds->resolve(&cc); + TSM_ASSERT("Retrieved credential was null", cred!=NULL); // Freshen timestamp and ID. toSend->setIssueInstant(time(NULL)); @@ -67,18 +68,23 @@ public: encoder_config->getDocumentElement()->setAttributeNS(NULL,lit2.get(),lit3.get()); auto_ptr encoder( SAMLConfig::getConfig().MessageEncoderManager.newPlugin( - samlconstants::SAML1_PROFILE_BROWSER_POST, encoder_config->getDocumentElement() + samlconstants::SAML1_PROFILE_BROWSER_POST, pair(encoder_config->getDocumentElement(),NULL) ) ); - encoder->encode(*this,toSend.get(),"https://sp.example.org/SAML/SSO","https://sp.example.org/","state",cred); + + Locker locker(m_metadata); + encoder->encode( + *this,toSend.get(),"https://sp.example.org/SAML/SSO",m_metadata->getEntityDescriptor("https://sp.example.org/"),"state",NULL,cred + ); toSend.release(); // Decode message. string relayState; auto_ptr decoder( - SAMLConfig::getConfig().MessageDecoderManager.newPlugin(samlconstants::SAML1_PROFILE_BROWSER_POST, NULL) + SAMLConfig::getConfig().MessageDecoderManager.newPlugin( + samlconstants::SAML1_PROFILE_BROWSER_POST, pair(NULL,NULL) + ) ); - Locker locker(m_metadata); auto_ptr response(dynamic_cast(decoder->decode(relayState,*this,policy))); // Test the results.