From 2e17ac3af7176460f4ddd072dc038c6415b0d4dc Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Mon, 26 Jul 2010 00:15:55 +0000 Subject: [PATCH] https://issues.shibboleth.net/jira/browse/SSPCPP-298 --- shibsp/metadata/DynamicMetadataProvider.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shibsp/metadata/DynamicMetadataProvider.cpp b/shibsp/metadata/DynamicMetadataProvider.cpp index 25bc2e7..291bef1 100644 --- a/shibsp/metadata/DynamicMetadataProvider.cpp +++ b/shibsp/metadata/DynamicMetadataProvider.cpp @@ -158,7 +158,9 @@ saml2md::EntityDescriptor* DynamicMetadataProvider::resolve(const saml2md::Metad name = temp.get(); } else if (criteria.artifact) { - throw saml2md::MetadataException("Unable to resolve metadata dynamically from an artifact."); + if (m_subst.empty() && (m_regex.empty() || m_match.empty())) + throw saml2md::MetadataException("Unable to resolve metadata dynamically from an artifact."); + name = "{sha1}" + criteria.artifact->getSource(); } // Possibly transform the input into a different URL to use. @@ -197,7 +199,9 @@ saml2md::EntityDescriptor* DynamicMetadataProvider::resolve(const saml2md::Metad if (!mpc) throw saml2md::MetadataException("Dynamic MetadataProvider requires Shibboleth-aware lookup criteria, check calling code."); const PropertySet* relyingParty; - if (criteria.entityID_unicode) + if (criteria.artifact) + relyingParty = mpc->application.getRelyingParty((XMLCh*)nullptr); + else if (criteria.entityID_unicode) relyingParty = mpc->application.getRelyingParty(criteria.entityID_unicode); else { auto_ptr_XMLCh temp2(name.c_str()); -- 2.1.4