code: protected AbstractMetadataResolver buildMetadataResolverFrom(final SamlRegisteredService service,
                                                                   final SamlMetadataDocument metadataDocument) {
          try {
              val desc = StringUtils.defaultString(service.getDescription(), service.getName());
              val metadataResource = ResourceUtils.buildInputStreamResourceFrom(metadataDocument.getDecodedValue(), desc);
              val metadataResolver = new InMemoryResourceMetadataResolver(metadataResource, configBean);
  
              val metadataFilterList = new ArrayList<MetadataFilter>();
              if (StringUtils.isNotBlank(metadataDocument.getSignature())) {
                  val signatureResource = ResourceUtils.buildInputStreamResourceFrom(metadataDocument.getSignature(), desc);
                  buildSignatureValidationFilterIfNeeded(service, metadataFilterList, signatureResource);
              }
              configureAndInitializeSingleMetadataResolver(metadataResolver, service, metadataFilterList);
              return metadataResolver;
          } catch (final Exception e) {
              LOGGER.error(e.getMessage(), e);
          }
          return null;
      }
docs: Build metadata resolver from document.
  
  @param service          the service
  @param metadataDocument the metadata document
  @return the metadata resolver