添加Security.json后,Apache Solr将阻止API。如何解开API调用?
我创建了 security.json 文件来为我的应用程序添加基本身份验证和授权,该应用程序是在后端的 Node js 中开发的,在前端是 React js 。 我正在使用 solr 8.8.0。
这是 security.json 代码,
{
"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"}
}
}
主要目的是在点击以下 URL 时启用身份验证 应询问 http://localhost:8983/solr 第一个用户名和密码。 上面的脚本确实要求用户名和密码,但它阻止使用 solr 的 API 调用。
I have created security.json file to add basic authentication and authorization for my application which is developed in node js in backend and react js in front end.
I am using solr 8.8.0.
Here is security.json code
{
"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"}
}
}
Main purpose here to enable authentication in when hit following URL
http://localhost:8983/solr first user name and password should be asked.
Above script does ask for user name and password but it is blocking API calls which are using solr.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论