Solr身份验证

您必须首先创建一个security.json文件。在使用security.json启用插件一节中详细描述了此文件及其放置位置。

对于基本身份验证,该security.json文件必须具有authentication定义用于身份验证的类的部分。用户名和密码(作为sha256(password + salt)哈希)可以在创建文件时添加,也可以稍后使用基本身份验证API添加,如下所述。

{
"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"} 
}}

image

security.json :文件必须在solr关闭时创建,放在:

image

以上步骤完成后: http://localhost:8983/solr/#/login

image

猜你喜欢

转载自www.cnblogs.com/dgwblog/p/12364105.html