solr8加鉴权

1:拷贝security.json到目录webapps/solr_home/下,security.json的内容如下:

{

"authentication":{

"blockUnknown":true,

"class":"solr.BasicAuthPlugin",

"credentials":{

"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="

},

"":{"v":0}},

"authorization":{

"class":"solr.RuleBasedAuthorizationPlugin",

"permissions":[{

"name":"security-edit",

"role":"admin"}],

"user-role":{"solr":"admin"}}}

###以上代表solr的用户名和密码为: solr/SolrRocks

2: 启动solr

3: 修改用户名密码(需要借助curl工具)

##修改solr登录密码

curl --user solr:SolrRocks http://192.168.1.176:9081/solr/admin/authentication -H "Content-type:application/json" -d "{\"set-user\": {\"king\" : \"123456\"}}"

##删除solr用户

curl --user solr:SolrRocks http://192.168.1.176:9081/solr/admin/authentication -H "Content-type:application/json" -d "{\"delete-user\": [\"solr\"]}"

##查看权限

http://192.168.1.176:9081/solr/admin/authentication

相关推荐
羊锦磊10 分钟前
[ 项目开发 1.0 ] 新闻网站的开发流程和注意事项
java·数据库·spring boot·redis·spring·oracle·json
码上淘金15 小时前
在 YAML 中如何将 JSON 对象作为字符串整体赋值?——兼谈 Go Template 中的 fromJson 使用
java·golang·json
z2014z18 小时前
LitJSON 轻量级、高效易用的 .NET JSON 库 深度解析与实战指南
json·.net
ToDetect1 天前
四大主流浏览器Chrome、Edge、Safari、Firefox内核检测免费工具评测
chrome·todetect·浏览器内核检测·浏览器指纹检测
AAA阿giao1 天前
JavaScript 深拷贝全解析:从栈与堆内存机制到安全对象复制实践
前端·javascript·json
l1t1 天前
DeepSeek辅助编写转换DuckDB json格式执行计划到PostgreSQL格式的Python程序
数据库·python·postgresql·json·执行计划
blackorbird1 天前
谷歌 Chrome 浏览器的指纹识别技术,一边反追踪一边搞追踪
前端·chrome
眠りたいです2 天前
基于脚手架微服务的视频点播系统-客户端业务逻辑处理部分(三)-客户端主体部分完结
c++·微服务·云原生·架构·json·restful·qt6.7
code bean2 天前
【C#笔记】Newtonsoft.Json 中 `[JsonIgnore]` 的作用详解
笔记·c#·json
李少兄2 天前
解决 Chrome 下载 `.crx` 文件被自动删除及“无法安装扩展程序,因为它使用了不受支持的清单版本”问题
前端·chrome