);
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);
+
// Freshen timestamp and ID.
toSend->setIssueInstant(time(NULL));
toSend->setResponseID(NULL);
samlconstants::SAML1_PROFILE_BROWSER_POST, encoder_config->getDocumentElement()
)
);
- encoder->encode(*this,toSend.get(),"https://sp.example.org/SAML/SSO","https://sp.example.org/","state",m_creds);
+
+ 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.
auto_ptr<MessageDecoder> decoder(
SAMLConfig::getConfig().MessageDecoderManager.newPlugin(samlconstants::SAML1_PROFILE_BROWSER_POST, NULL)
);
- Locker locker(m_metadata);
auto_ptr<Response> response(dynamic_cast<Response*>(decoder->decode(relayState,*this,policy)));
// Test the results.
// Trigger a replay.
policy.reset();
- TSM_ASSERT_THROWS("Did not catch the replay.", decoder->decode(relayState,*this,policy), BindingException);
+ TSM_ASSERT_THROWS("Did not catch the replay.", decoder->decode(relayState,*this,policy), SecurityPolicyException);
}
catch (XMLToolingException& ex) {
TS_TRACE(ex.what());