From a41638b428c26e5fcafa0fda0c48d20ea1a18270 Mon Sep 17 00:00:00 2001 From: Priyank Bagrecha Date: Tue, 19 Sep 2023 09:18:59 -0700 Subject: [PATCH] Change log message from warning to trace on WWW-Authenticate challenge (#3364) ### Description Change warning message No 'Basic Authorization' header, send 401 and 'WWW-Authenticate Basic' to trace ### Issues Resolved - Resolves #3273 ### Check List - [ ] New functionality includes testing - [ ] New functionality has been documented - [X] Commits are signed per the DCO using --signoff By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). --------- Signed-off-by: Priyank Bagrecha Co-authored-by: Priyank Bagrecha --- .../java/org/opensearch/security/auth/BackendRegistry.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/opensearch/security/auth/BackendRegistry.java b/src/main/java/org/opensearch/security/auth/BackendRegistry.java index c16f90fb6a..ad1406426b 100644 --- a/src/main/java/org/opensearch/security/auth/BackendRegistry.java +++ b/src/main/java/org/opensearch/security/auth/BackendRegistry.java @@ -282,7 +282,9 @@ && isBlocked(((InetSocketAddress) request.getHttpChannel().getRemoteAddress()).g if (authDomain.isChallenge() && httpAuthenticator.reRequestAuthentication(channel, null)) { auditLog.logFailedLogin("", false, null, request); - log.warn("No 'Authorization' header, send 401 and 'WWW-Authenticate Basic'"); + if (isTraceEnabled) { + log.trace("No 'Authorization' header, send 401 and 'WWW-Authenticate Basic'"); + } return false; } else { // no reRequest possible