添加Security.json后,Apache Solr将阻止API。如何解开API调用?

发布于 2025-01-19 21:27:51 字数 792 浏览 2 评论 0原文

我创建了 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.
enter image description here
Above script does ask for user name and password but it is blocking API calls which are using solr.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文