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

Chantal Ackermann commented on SOLR-1490:
-----------------------------------------

It would be nice if the user info from the URL could be used as done in this 
code snippet:

{code:java}
URL url = new URL("http://user:[email protected]/url";);
URLConnection urlConnection = url.openConnection();

if (url.getUserInfo() != null) {
    String basicAuth = "Basic " + new String(new 
Base64().encode(url.getUserInfo().getBytes()));
    urlConnection.setRequestProperty("Authorization", basicAuth);
}
{code}
taken from http://stackoverflow.com/a/13122190/621690

InputStream inputStream = urlConnection.getInputStream();

> URLDataSource should be able to handle HTTP authentication
> ----------------------------------------------------------
>
>                 Key: SOLR-1490
>                 URL: https://issues.apache.org/jira/browse/SOLR-1490
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>            Reporter: Adam Foltzer
>            Assignee: Noble Paul
>         Attachments: SOLR-1490.patch
>
>
> Right now, there seems to be no way to provide HTTP authentication 
> (username/password) to the URLDataSource. This makes any password-protected 
> data sources inaccessible for indexing. I would try and add support myself, 
> but with all things security-related, I'm fearful of shooting myself in the 
> foot with systems I don't fully understand. Thanks for your time/feedback!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to