manifoldcf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erlend Garåsen (JIRA) <j...@apache.org>
Subject [jira] [Commented] (CONNECTORS-1564) Support preemptive authentication to Solr connector
Date Wed, 30 Jan 2019 16:55:00 GMT

    [ https://issues.apache.org/jira/browse/CONNECTORS-1564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16756324#comment-16756324
] 

Erlend Garåsen commented on CONNECTORS-1564:
--------------------------------------------

I have a reason to believe that this is SolrJ related. The header does not show up in my connector's
log, nor do the user agent. So I guess SolrJ overwrites the settings. This is what I configured
in my connector:
{code:java}
HttpClientBuilder builder = HttpClients.custom();
  builder.setUserAgent("ninja");
  builder.setDefaultRequestConfig(RequestConfig.custom().setExpectContinueEnabled(true).build());

  AuthScope scope = new AuthScope(solrUrl.getHost(), solrUrl.getPort(), solrRealm);
  Credentials creds = new UsernamePasswordCredentials(solrUsername, solrPassword);
  BasicCredentialsProvider cp = new BasicCredentialsProvider();
  cp.setCredentials(scope, creds);
  builder.setDefaultCredentialsProvider(cp);

  HttpClient httpClient = builder.build();
  return new HttpSolrClient.Builder()
    .withBaseSolrUrl(solrUrl.toString())
    .withHttpClient(httpClient)
    .allowCompression(true).build();
}{code}
The protocol version is 1.1
{code:java}
DEBUG 30.01.2019 17:40:04:396 (LoggingManagedHttpClientConnection.java:onRequestSubmitted:133)
- http-outgoing-0 >> GET /solr/uio/select?q=*%3A*&fq=%28+content_no%3A%2F%5B0-9%5D%7B11%7D%2F+OR+content_en%3A%2F%5B0-9%5D%7B11%7D%2F+OR+%28content_no%3A%2F%5B0-9%5D%7B6%7D%2F+AND+content_no%3A%2F%5B0-9%5D%7B5%7D%2F%29+OR+%28content_en%3A%2F%5B0-9%5D%7B6%7D%2F+AND+content_en%3A%2F%5B0-9%5D%7B5%7D%2F%29+OR+%28content_no%3A%2F%5B0-9%5D%7B2%7D.%5B0-9%5D%7B2%7D.%5B0-9%5D%7B2%2C4%7D%2F+AND+content_no%3A%2F%5B0-9%5D%7B5%7D%2F%29+OR+%28content_en%3A%2F%5B0-9%5D%7B2%7D.%5B0-9%5D%7B2%7D.%5B0-9%5D%7B2%2C4%7D%2F+AND+content_en%3A%2F%5B0-9%5D%7B5%7D%2F%29+%29+AND+acl%3A%22pseudo%3Aall%22&start=0&rows=500&defType=lucene&wt=javabin&version=2
HTTP/1.1{code}
The user agent has been changed and is *not* "Ninja":
{code:java}
DEBUG 30.01.2019 17:40:04:397 (LoggingManagedHttpClientConnection.java:onRequestSubmitted:136)
- http-outgoing-0 >> User-Agent: Solr[org.apache.solr.client.solrj.impl.HttpSolrClient]
1.0{code}
And no expect continue:
{code:java}
DEBUG 30.01.2019 17:40:04:398 (LoggingManagedHttpClientConnection.java:onRequestSubmitted:136)
- http-outgoing-0 >> Host: solr-prod01.uio.no
DEBUG 30.01.2019 17:40:04:398 (LoggingManagedHttpClientConnection.java:onRequestSubmitted:136)
- http-outgoing-0 >> Connection: Keep-Alive{code}
 

> Support preemptive authentication to Solr connector
> ---------------------------------------------------
>
>                 Key: CONNECTORS-1564
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-1564
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: Lucene/SOLR connector
>            Reporter: Erlend Garåsen
>            Assignee: Karl Wright
>            Priority: Major
>         Attachments: CONNECTORS-1564.patch
>
>
> We should post preemptively in case the Solr server requires basic authentication. This
will make the communication between ManifoldCF and Solr much more effective instead of the
following:
>  * Send a HTTP POST request to Solr
>  * Solr sends a 401 response
>  * Send the same request, but with a "{{Authorization: Basic}}" header
> With preemptive authentication, we can send the header in the first request.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message