This question was asked in the follow-up question to my this SO answer of how to secure JHLRC in this comment, where I explained how to send Basic Credential in Elasticsearch JHLRC request but it was not at the client level and was at the request level.
I feel configure at the client level, would avoid repeating the same code again in cases, where you are dealing with only a few users it would be helpful to configure the credentials in the client itself.