向SOLR 8.6.1添加基本身份验证

发布于 2025-02-12 15:31:35 字数 690 浏览 1 评论 0原文

在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 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一场春暖 2025-02-19 15:31:35

您必须在客户端上设置正确的选项 - 不在服务器上。这是一种影响端与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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文