Solr 6.6.1 中使用 REST 的基本身份验证
basic authentication with REST in Solr 6.6.1
我已经按照他们的参考指南部署了具有基本身份验证的 Apache Solr 6.6.1。最后他们讨论了如何安全地使用 curl。就我而言,我使用 REST API 来查询 SOLR。
由于基本身份验证,我正在使用此查询。 https://user:pswd@serverhost/solr/...
这样我的用户和密码就会暴露出来。我想知道在 REST API 中使用基本身份验证的最安全方法,不会暴露给外部世界。
如你所见here:
The use of these URLs is deprecated. In Chrome, the username:password@
part in URLs is even stripped out for security reasons. In Firefox, it
is checked if the site actually requires authentication and if not,
Firefox will warn the user with a prompt "You are about to log in to
the site “www.example.com” with the username “username”, but the
website does not require authentication. This may be an attempt to
trick you.".
您不需要在您的 URL 中公开它,您应该在您的请求中添加一个 "Authorization" Header。该值将 "username:password" 以 Base64 编码,这不安全,但由于您使用的是 https,它将受到保护。
header 的完整值类似于 "Basic dXNlcm5hbWU6cGFzc3dvcmQ="。它由身份验证类型 ("Basic") 加上一个空格加上以 Base64 编码的 "username:password" 的值组成。
我已经按照他们的参考指南部署了具有基本身份验证的 Apache Solr 6.6.1。最后他们讨论了如何安全地使用 curl。就我而言,我使用 REST API 来查询 SOLR。 由于基本身份验证,我正在使用此查询。 https://user:pswd@serverhost/solr/... 这样我的用户和密码就会暴露出来。我想知道在 REST API 中使用基本身份验证的最安全方法,不会暴露给外部世界。
如你所见here:
The use of these URLs is deprecated. In Chrome, the username:password@ part in URLs is even stripped out for security reasons. In Firefox, it is checked if the site actually requires authentication and if not, Firefox will warn the user with a prompt "You are about to log in to the site “www.example.com” with the username “username”, but the website does not require authentication. This may be an attempt to trick you.".
您不需要在您的 URL 中公开它,您应该在您的请求中添加一个 "Authorization" Header。该值将 "username:password" 以 Base64 编码,这不安全,但由于您使用的是 https,它将受到保护。
header 的完整值类似于 "Basic dXNlcm5hbWU6cGFzc3dvcmQ="。它由身份验证类型 ("Basic") 加上一个空格加上以 Base64 编码的 "username:password" 的值组成。