/*
- * Copyright 2001-2007 Internet2
+ * Copyright 2001-2010 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "internal.h"
#include "Application.h"
-#include "exceptions.h"
#include "binding/ArtifactResolver.h"
#include "binding/SOAPClient.h"
#include "security/SecurityPolicy.h"
+#include <saml/exceptions.h>
#include <saml/saml1/core/Protocols.h>
#include <saml/saml1/binding/SAML1SOAPClient.h>
#include <saml/saml2/core/Protocols.h>
#include <saml/saml2/binding/SAML2Artifact.h>
#include <saml/saml2/binding/SAML2SOAPClient.h>
+#include <saml/saml2/metadata/Metadata.h>
#include <saml/saml2/metadata/MetadataCredentialCriteria.h>
#include <saml/util/SAMLConstants.h>
using namespace xmltooling;
using namespace std;
+ArtifactResolver::ArtifactResolver()
+{
+}
+
+ArtifactResolver::~ArtifactResolver()
+{
+}
+
saml1p::Response* ArtifactResolver::resolve(
const vector<SAMLArtifact*>& artifacts,
const IDPSSODescriptor& idpDescriptor,
bool foundEndpoint = false;
auto_ptr_XMLCh binding(samlconstants::SAML1_BINDING_SOAP);
- saml1p::Response* response=NULL;
+ saml1p::Response* response=nullptr;
const vector<ArtifactResolutionService*>& endpoints=idpDescriptor.getArtifactResolutionServices();
for (vector<ArtifactResolutionService*>::const_iterator ep=endpoints.begin(); !response && ep!=endpoints.end(); ++ep) {
try {
throw MetadataException("No compatible endpoint found in issuer's metadata.");
else if (!response)
throw BindingException("Unable to resolve artifact(s) into a SAML response.");
- const xmltooling::QName* code = (response->getStatus() && response->getStatus()->getStatusCode()) ? response->getStatus()->getStatusCode()->getValue() : NULL;
+ const xmltooling::QName* code = (response->getStatus() && response->getStatus()->getStatusCode()) ? response->getStatus()->getStatusCode()->getValue() : nullptr;
if (!code || *code != saml1p::StatusCode::SUCCESS) {
delete response;
throw BindingException("Identity provider returned a SAML error in response to artifact(s).");
bool foundEndpoint = false;
auto_ptr_XMLCh binding(samlconstants::SAML20_BINDING_SOAP);
- ArtifactResponse* response=NULL;
+ ArtifactResponse* response=nullptr;
const vector<ArtifactResolutionService*>& endpoints=ssoDescriptor.getArtifactResolutionServices();
for (vector<ArtifactResolutionService*>::const_iterator ep=endpoints.begin(); !response && ep!=endpoints.end(); ++ep) {
try {