- if (!result.first && !criteria.validOnly && range.first!=range.second)
- result.first = range.first->second;
-
- if (result.first && criteria.role && criteria.protocol) {
+ if (!result.first && range.first!=range.second) {
+ Category& log = Category::getInstance(SAML_LOGCAT".MetadataProvider");
+ if (criteria.validOnly) {
+ log.warn("ignored expired metadata instance for (%s)", range.first->first.c_str());
+ }
+ else {
+ log.info("no valid metadata found, returning expired instance for (%s)", range.first->first.c_str());
+ result.first = range.first->second;
+ }
+ }
+
+ if (result.first && criteria.role) {