向SOLR 8.6.1添加基本身份验证
在Solr 8.6.1添加基本身份验证时,我们有一些困难。我们正在关注此文档,我们已经创建了<代码> security.json file(成功)全局身份验证设置:我们确实通过了-dsolr.httpclient.builder.factory = org.apache.solr.client.solrj.impl.preementBasicauthClientBuilderFactory
=用户名:密码属性如下:
// the following is the last time of our Solr Dockerfile:
CMD ["solr-foreground", "-Dsolr.httpclient.builder.factory=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory", "-Dbasicauth=username:secret"]
但是,从Solr都带有错误401需要身份验证
。
有人可以让我们知道我们错过了什么吗?
We are having some difficulty when adding basic authentication to Solr 8.6.1. We are following this document, and we have created security.json
file, which is successful (since Solr instance will ask userId and password when it starts.) Our difficulty happens when trying to enable the global authentication settings: we did pass the -Dsolr.httpclient.builder.factory=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory
system property,and we also set the -Dbasicauth=username:password
property as follows:
// the following is the last time of our Solr Dockerfile:
CMD ["solr-foreground", "-Dsolr.httpclient.builder.factory=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory", "-Dbasicauth=username:secret"]
However, the calls to retrieve data from Solr all come back with Error 401 require authentication
.
Could someone please kindly let us know what did we miss?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须在客户端上设置正确的选项 - 不在服务器上。这是一种影响端与SOLR身份验证的客户端的设置。
因此,运行应用程序时,将参数提供给
java
命令(或将其配置为通过ant/maven/gradle/etc的默认参数。将其设置在docker容器上,将不会做任何有用的事情。
You'll have to set the correct options on the client - not on the server. This is a setting that affects how the client that connects to Solr authenticates.
So when running your application, give the parameter to the
java
command (or configure it to be the default parameter through ant/maven/gradle/etc.Setting it on the docker container will not do anything useful.