void testSAML1Artifact() {\r
try {\r
QName idprole(samlconstants::SAML20MD_NS, IDPSSODescriptor::LOCAL_NAME);\r
- SecurityPolicy policy(m_rules1, m_metadata, &idprole, m_trust, false);\r
+ SecurityPolicy policy(m_metadata, &idprole, m_trust, false);\r
+ policy.getRules().assign(m_rules.begin(), m_rules.end());\r
\r
// Read message to use from file.\r
string path = data_path + "saml1/binding/SAML1Assertion.xml";\r
janitor.release();\r
\r
CredentialCriteria cc;\r
- cc.setUsage(CredentialCriteria::SIGNING_CREDENTIAL);\r
+ cc.setUsage(Credential::SIGNING_CREDENTIAL);\r
Locker clocker(m_creds);\r
const Credential* cred = m_creds->resolve(&cc);\r
TSM_ASSERT("Retrieved credential was null", cred!=NULL);\r
\r
// Encode message.\r
auto_ptr<MessageEncoder> encoder(\r
- SAMLConfig::getConfig().MessageEncoderManager.newPlugin(samlconstants::SAML1_PROFILE_BROWSER_ARTIFACT, NULL)\r
+ SAMLConfig::getConfig().MessageEncoderManager.newPlugin(\r
+ samlconstants::SAML1_PROFILE_BROWSER_ARTIFACT, pair<const DOMElement*,const XMLCh*>(NULL,NULL)\r
+ )\r
);\r
- encoder->setArtifactGenerator(this);\r
Locker locker(m_metadata);\r
encoder->encode(\r
- *this,toSend.get(),"https://sp.example.org/SAML/SSO",m_metadata->getEntityDescriptor("https://sp.example.org/"),"state",cred\r
+ *this,toSend.get(),"https://sp.example.org/SAML/SSO",m_metadata->getEntityDescriptor("https://sp.example.org/"),"state",this,cred\r
);\r
toSend.release();\r
\r
// Decode message.\r
string relayState;\r
auto_ptr<MessageDecoder> decoder(\r
- SAMLConfig::getConfig().MessageDecoderManager.newPlugin(samlconstants::SAML1_PROFILE_BROWSER_ARTIFACT, NULL)\r
+ SAMLConfig::getConfig().MessageDecoderManager.newPlugin(\r
+ samlconstants::SAML1_PROFILE_BROWSER_ARTIFACT, pair<const DOMElement*,const XMLCh*>(NULL,NULL)\r
+ )\r
);\r
decoder->setArtifactResolver(this);\r
auto_ptr<Response> response(dynamic_cast<Response*>(decoder->decode(relayState,*this,policy)));\r
// Test the results.\r
TSM_ASSERT_EQUALS("TARGET was not the expected result.", relayState, "state");\r
TSM_ASSERT("SAML Response not decoded successfully.", response.get());\r
- TSM_ASSERT("Message was not verified.", policy.isSecure());\r
+ TSM_ASSERT("Message was not verified.", policy.isAuthenticated());\r
auto_ptr_char entityID(policy.getIssuer()->getName());\r
TSM_ASSERT("Issuer was not expected.", !strcmp(entityID.get(),"https://idp.example.org/"));\r
TSM_ASSERT_EQUALS("Assertion count was not correct.", response->getAssertions().size(), 1);\r
response->setSignature(SignatureBuilder::buildSignature());\r
vector<Signature*> sigs(1,response->getSignature());\r
CredentialCriteria cc;\r
- cc.setUsage(CredentialCriteria::SIGNING_CREDENTIAL);\r
+ cc.setUsage(Credential::SIGNING_CREDENTIAL);\r
Locker clocker(m_creds);\r
const Credential* cred = m_creds->resolve(&cc);\r
TSM_ASSERT("Retrieved credential was null", cred!=NULL);\r