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

Jan Høydahl commented on SOLR-8440:
-----------------------------------

[~ichattopadhyaya] did you actually test your patch, copying the two lines into 
{{solr.in.sh}}?
Cause when I try it here, I get nullpointer exception in 
PreemptiveBasicAuthClientBuilderFactory:
{noformat}
solr@osboxes:/opt/solr$ bin/solr status

Found 1 Solr nodes: 

Solr process 6555 running on port 8983
Exception in thread "main" java.lang.ExceptionInInitializerError
        at org.apache.solr.util.SolrCLI.getHttpClient(SolrCLI.java:567)
        at org.apache.solr.util.SolrCLI$StatusTool.getStatus(SolrCLI.java:891)
        at org.apache.solr.util.SolrCLI$StatusTool.runImpl(SolrCLI.java:849)
        at org.apache.solr.util.SolrCLI$ToolBase.runTool(SolrCLI.java:160)
        at org.apache.solr.util.SolrCLI.main(SolrCLI.java:258)
Caused by: java.lang.NullPointerException
        at 
org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory.initHttpClientBuilder(PreemptiveBasicAuthClientBuilderFactory.java:114)
        at 
org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory.getHttpClientBuilder(PreemptiveBasicAuthClientBuilderFactory.java:109)
        at 
org.apache.solr.client.solrj.impl.HttpClientUtil.<clinit>(HttpClientUtil.java:142)
        ... 5 more
{noformat}

Turns out you have a typo in the instructions, see 
[SolrCLI.java#L3711|https://github.com/apache/lucene-solr/blob/c9541c216d57ff816d64beef566990d8754008db/solr/core/src/java/org/apache/solr/util/SolrCLI.java#L3711],
 it should be {{-Dbasicauth=}} without uppercase "A".

*Other nitpick:*
* Method {{updateIncludeFileEnableAuth}} takes username, password as args but 
they are never used
* Wrong code indent in 
[SolrCLI#3629-3671|https://github.com/apache/lucene-solr/blob/c9541c216d57ff816d64beef566990d8754008db/solr/core/src/java/org/apache/solr/util/SolrCLI.java#L3629-L3671]


> Script support for enabling basic auth
> --------------------------------------
>
>                 Key: SOLR-8440
>                 URL: https://issues.apache.org/jira/browse/SOLR-8440
>             Project: Solr
>          Issue Type: New Feature
>          Components: scripts and tools
>            Reporter: Jan Høydahl
>            Assignee: Ishan Chattopadhyaya
>              Labels: authentication, security
>             Fix For: 6.6, master (7.0)
>
>         Attachments: SOLR-8440.patch, SOLR-8440.patch, SOLR-8440.patch, 
> SOLR-8440.patch, SOLR-8440.patch, SOLR-8440.patch, SOLR-8440.patch, 
> SOLR-8440.patch
>
>
> Now that BasicAuthPlugin will be able to work without an AuthorizationPlugin 
> (SOLR-8429), it would be sweet to provide a super simple way to "Password 
> protect Solr"™ right from the command line:
> {noformat}
> bin/solr basicAuth -adduser -user solr -pass SolrRocks
> {noformat}
> It would take the mystery out of enabling one single password across the 
> board. The command would do something like this
> # Check if HTTPS is enabled, and if not, print a friendly warning
> # Check if {{/security.json}} already exists
> ## NO => create one with only plugin class defined
> ## YES => Abort if exists but plugin is not {{BasicAuthPlugin}}
> # Using security REST API, add the new user



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to