- multimap<string,Attribute*> resolvedAttributes;
- AttributeExtractor* extractor = application.getAttributeExtractor();
- if (extractor) {
- m_log.debug("extracting pushed attributes...");
- Locker extlocker(extractor);
- if (n) {
- try {
- extractor->extractAttributes(application, policy.getIssuerMetadata(), *n, resolvedAttributes);
- }
- catch (exception& ex) {
- m_log.error("caught exception extracting attributes: %s", ex.what());
- }
- }
- for (vector<const opensaml::Assertion*>::const_iterator t = tokens.begin(); t!=tokens.end(); ++t) {
- try {
- extractor->extractAttributes(application, policy.getIssuerMetadata(), *(*t), resolvedAttributes);
- }
- catch (exception& ex) {
- m_log.error("caught exception extracting attributes: %s", ex.what());
- }
- }
-
- AttributeFilter* filter = application.getAttributeFilter();
- if (filter && !resolvedAttributes.empty()) {
- BasicFilteringContext fc(application, policy.getIssuerMetadata());
- Locker filtlocker(filter);
- try {
- filter->filterAttributes(fc, resolvedAttributes);
- }
- catch (exception& ex) {
- m_log.error("caught exception filtering attributes: %s", ex.what());
- m_log.error("dumping extracted attributes due to filtering exception");
- for_each(resolvedAttributes.begin(), resolvedAttributes.end(), cleanup_pair<string,shibsp::Attribute>());
- resolvedAttributes.clear();
- }
- }
- }