(总初学者问题警报!)我正在尝试按照此文档在 SOLR 8.3(docker 容器:FROM solr:8.3)上设置基本身份验证:
我添加了 /var/solr/data/security.json:
{
"authentication":{
"blockUnknown": true,
"class":"solr.BasicAuthPlugin",
"credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="},
"realm":"My Solr users",
"forwardCredentials": false
},
"authorization":{
"class":"solr.RuleBasedAuthorizationPlugin",
"permissions":[{"name":"security-edit",
"role":"admin"}],
"user-role":{"solr":"admin"}
}}
当我尝试更改默认管理员密码时:
curl --user solr:SolrRocks http://10.x.x.x:8983/solr/admin/authentication -H 'Content-type:application/json' -d '{"set-user": {"solr" : "MyNewSuperSecurePass" }}'
我得到错误:
"responseHeader":{
"status":400,
"QTime":1},
"error":{
"metadata":[
"error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.common.SolrException"],
"msg":"No authentication plugin configured",
"code":400}}