#define __saml_soap11client_h__
#include <saml/binding/SecurityPolicy.h>
+#include <saml/saml2/metadata/MetadataCredentialCriteria.h>
#include <xmltooling/soap/SOAPClient.h>
namespace opensaml {
* @param policy reference to SecurityPolicy to apply
* @param validating controls schema validation
*/
- SOAPClient(SecurityPolicy& policy, bool validating=false)
- : soap11::SOAPClient(validating), m_policy(policy), m_force(true), m_correlate(NULL) {}
+ SOAPClient(SecurityPolicy& policy)
+ : soap11::SOAPClient(policy.getValidating()), m_policy(policy), m_force(true), m_peer(NULL), m_criteria(NULL) {
+ }
virtual ~SOAPClient() {
- XMLString::release(&m_correlate);
}
/**
}
/**
- * Override prepares the SecurityPolicy by clearing Issuer identity, in case the policy
- * is reused.
+ * SAML-specific method uses a RoleDescriptor to determine the peer name and prepare the
+ * transport layer with peer credential information. The SecurityPolicy is also reset,
+ * in case the policy is reused.
*
* @param env SOAP envelope to send
- * @param peer peer to send message to, expressed in TrustEngine terms
+ * @param peer peer to send message to, expressed in metadata criteria terms
* @param endpoint URL of endpoint to recieve message
*/
- void send(const soap11::Envelope& env, const xmltooling::KeyInfoSource& peer, const char* endpoint);
+ void send(const soap11::Envelope& env, saml2md::MetadataCredentialCriteria& peer, const char* endpoint);
/**
* Override applies SecurityPolicy to envelope before returning it.
void reset();
+ /**
+ * Returns the SecurityPolicy supplied to the client.
+ *
+ * @return the associated SecurityPolicy
+ */
+ SecurityPolicy& getPolicy() const {
+ return m_policy;
+ }
+
protected:
/**
* Override prepares transport by assigning an X509TrustEngine to it, if one is
*
* @param transport reference to transport layer
*/
- void prepareTransport(const xmltooling::SOAPTransport& transport);
+ void prepareTransport(xmltooling::SOAPTransport& transport);
/** Reference to security policy to apply. */
SecurityPolicy& m_policy;
/** Flag controlling whether transport/peer authn is mandatory. */
bool m_force;
- /** Message correlation ID. */
- XMLCh* m_correlate;
-
- private:
+ /** Metadata-based peer identity. */
const saml2md::RoleDescriptor* m_peer;
+
+ /** Metadata-based CredentialCriteria for supplying credentials to TrustEngine. */
+ saml2md::MetadataCredentialCriteria* m_criteria;
};
};