+#ifndef SHIBSP_LITE
+
+void RemotedResolver::resolve(
+ AttributeExtractor* extractor,
+ const Application& app,
+ const RoleDescriptor* issuer,
+ const XMLObject& token,
+ vector<Attribute*>& resolvedAttrs
+ ) const
+{
+ vector<Attribute*> extractedAttrs;
+ try {
+ extractor->extractAttributes(app, issuer, token, extractedAttrs);
+ }
+ catch (exception& ex) {
+ Category::getInstance(SHIBRESOLVER_LOGCAT).error("caught exception extracting attributes: %s", ex.what());
+ }
+
+ AttributeFilter* filter = app.getAttributeFilter();
+ if (filter && !extractedAttrs.empty()) {
+ BasicFilteringContext fc(app, extractedAttrs, issuer);
+ Locker filtlocker(filter);
+ try {
+ filter->filterAttributes(fc, extractedAttrs);
+ }
+ catch (exception& ex) {
+ Category::getInstance(SHIBRESOLVER_LOGCAT).error("caught exception filtering attributes: %s", ex.what());
+ Category::getInstance(SHIBRESOLVER_LOGCAT).error("dumping extracted attributes due to filtering exception");
+ for_each(extractedAttrs.begin(), extractedAttrs.end(), xmltooling::cleanup<shibsp::Attribute>());
+ extractedAttrs.clear();
+ }
+ }
+
+ resolvedAttrs.insert(resolvedAttrs.end(), extractedAttrs.begin(), extractedAttrs.end());
+}
+
+const RoleDescriptor* RemotedResolver::lookup(
+ const Application& app, MetadataProvider* m, const char* entityID, const XMLCh* protocol
+ ) const
+{
+ if (!m)
+ return NULL;
+
+ MetadataProviderCriteria idpmc(app, entityID, &IDPSSODescriptor::ELEMENT_QNAME, protocol ? protocol : samlconstants::SAML20P_NS);
+ if (protocol)
+ idpmc.protocol2 = samlconstants::SAML20P_NS;
+ pair<const EntityDescriptor*,const RoleDescriptor*> entity = m->getEntityDescriptor(idpmc);
+ if (!entity.first) {
+ Category::getInstance(SHIBRESOLVER_LOGCAT).warn("unable to locate metadata for provider (%s)", entityID);
+ }
+ else if (!entity.second) {
+ MetadataProviderCriteria aamc(
+ app, entityID, &AttributeAuthorityDescriptor::ELEMENT_QNAME, protocol ? protocol : samlconstants::SAML20P_NS
+ );
+ if (protocol)
+ aamc.protocol2 = samlconstants::SAML20P_NS;
+ entity = m->getEntityDescriptor(aamc);
+ if (!entity.second) {
+ Category::getInstance(SHIBRESOLVER_LOGCAT).warn("unable to locate compatible IdP or AA role for provider (%s)", entityID);
+ }
+ }
+
+ return entity.second;
+}
+
+#endif
+