Github user janhoy commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/458#discussion_r240234930
--- Diff: solr/core/src/java/org/apache/solr/security/BasicAuthPlugin.java
---
@@ -172,6 +192,22 @@ public void closeRequest() {
Map<String, String> getPromptHeaders();
}
+ @Override
+ protected boolean interceptInternodeRequest(HttpRequest httpRequest,
HttpContext httpContext) {
+ if (forwardCredentials) {
+ if (httpContext instanceof HttpClientContext) {
+ HttpClientContext httpClientContext = (HttpClientContext)
httpContext;
+ if (httpClientContext.getUserToken() instanceof
BasicAuthUserPrincipal) {
+ BasicAuthUserPrincipal principal = (BasicAuthUserPrincipal)
httpClientContext.getUserToken();
+ String userPassBase64 =
Base64.encodeBase64String((principal.getName() + ":" +
principal.getPassword()).getBytes(StandardCharsets.UTF_8));
--- End diff --
UTF-8 is hardcoded, as it is also hardcoded on the backend side. Could
alternatively have sent a `charset=UTF-8` on the `WWW-authenticate` header from
the server to be explicit, but see no real need for that in the context of this
issue.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]