Revert to exception-based policy errors, add "secure" flag to policy to track authn.
[shibboleth/cpp-opensaml.git] / samltest / saml1 / binding / SAML1ArtifactTest.h
index e5ebe30..7ce89e2 100644 (file)
@@ -51,7 +51,7 @@ public:
     void testSAML1Artifact() {\r
         try {\r
             QName idprole(samlconstants::SAML20MD_NS, IDPSSODescriptor::LOCAL_NAME);\r
-            SecurityPolicy policy(m_rules, m_metadata, &idprole, m_trust);\r
+            SecurityPolicy policy(m_rules1, m_metadata, &idprole, m_trust);\r
 \r
             // Read message to use from file.\r
             string path = data_path + "saml1/binding/SAML1Assertion.xml";\r
@@ -68,7 +68,7 @@ public:
                 SAMLConfig::getConfig().MessageEncoderManager.newPlugin(samlconstants::SAML1_PROFILE_BROWSER_ARTIFACT, NULL)\r
                 );\r
             encoder->setArtifactGenerator(this);\r
-            encoder->encode(*this,toSend.get(),"https://sp.example.org/SAML/Artifact","https://sp.example.org/","state",m_creds);\r
+            encoder->encode(*this,toSend.get(),"https://sp.example.org/SAML/SSO","https://sp.example.org/","state",m_creds);\r
             toSend.release();\r
             \r
             // Decode message.\r
@@ -83,12 +83,13 @@ public:
             // 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.getIssuer()!=NULL);\r
+            TSM_ASSERT("Message was not verified.", policy.isSecure());\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
 \r
             // Trigger a replay.\r
+            policy.reset();\r
             TSM_ASSERT_THROWS("Did not catch the replay.", decoder->decode(relayState,*this,policy), BindingException);\r
         }\r
         catch (XMLToolingException& ex) {\r