Uploaded image for project: 'Spring Data for Apache Solr'
  1. Spring Data for Apache Solr
  2. DATASOLR-189

SolrServerUtils clone doesn't copy http client's credentials provider

    XMLWordPrintable

    Details

    • Sprint:
      52 - Evans GA

      Description

      If I create a SolrServer as such:

      BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
      credentialsProvider.setCredentials(AuthScope.ANY,
                      new UsernamePasswordCredentials(username, password));
      HttpClient httpClient = HttpClientBuilder.create()
                      .setDefaultCredentialsProvider(credentialsProvider)
                      .build();
      LBHttpSolrServer solrServer = new LBHttpSolrServer(httpClient, urls);
      

      Then create a `MultiCoreSolrServerFactory` as such:

      new MulticoreSolrServerFactory(solrServer, cores....)
      

      The HttpClient that's created by the cloneLBHttpSolrServer method in SolrServerUtils does not contain the credentials provider that's used in the LBHttpSolrServer.

      If the http client isn't cloned and preserve the credentials provider, then I cannot authenticate against the Solr server. If it matters, I'm using DataStax Enterprise and we credentials on our Cassandra keyspace, which requires the same authentication credentials for any Solr request.

      I confirmed this on spring data solr 1.2.0 and 1.2.2.

        Attachments

          Activity

            People

            Assignee:
            cstrobl Christoph Strobl
            Reporter:
            jinloes Jonathan Inloes
            Last updater:
            Jonathan Inloes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: