Solr Cloud with Basic Authentication fails - Unauthorized 401 Error from Solr Admin

淺唱寂寞╮ 提交于 2019-12-23 12:26:44

问题


I have setup SolrCloud using Solr 6.6.0 and Zookeeper 3.4.10. I am trying to setup Basic Authentication as per latest documentation at https://cwiki.apache.org/confluence/display/solr/Basic+Authentication+Plugin

Issue is that the authentication does not work. After setup, I am unable to access Solr Admin console as it does not accept the username/password that was setup.

Below are the Steps with detailed info:

1) Started Zookeeper listening on port 2181

2) Started Solr cloud mode connecting to Zookeeper

 solr start -c -s C:/solr-6.6.0_VM1/server/solr/cores -p 8983 -z 
    "localhost:2181";

3) Created security.json file (as per documentation):

{
"authentication":{    
"blockUnknown": true,    
"class":"solr.BasicAuthPlugin",    
"credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0=    
Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="}    
},    
"authorization":{    
"class":"solr.RuleBasedAuthorizationPlugin",    
"permissions":[{"name":"security-edit",    
"role":"admin"}],    
"user-role":{"solr":"admin"}    
}}    

4) Updated solr.in.cmd to enable authenticaiton on SOLR:

set SOLR_AUTH_TYPE=basic
set SOLR_AUTHENTICATION_OPTS="-Dbasicauth=solr:SolrRocks"

5) **Uploaded security.json file to Zookeeper:*

 server\scripts\cloud-scripts\zkcli -z localhost:2181 -cmd putfile 
    /security.json security.json

6) Restarted SOLR server

7) Opened SOLR Admin console: http://localhost:8983/solr/#/

I was asked username/password. I entered solr/SolrRocks The admin did not accept the password. When I close the login window, it shows "HTTP ERROR 401, Bad credentials"

Any idea why the authentication is not working on Solr? I have tried the steps exactly as documented. Appreciate your help!

Thanks,

Nishant

来源:https://stackoverflow.com/questions/45226188/solr-cloud-with-basic-authentication-fails-unauthorized-401-error-from-solr-ad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!