From b2c7d75db2f3805b91d76335bb43845fdb41f41c Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Tue, 15 Aug 2023 23:30:25 -0700 Subject: [PATCH] Address some comment 2 Signed-off-by: Ryan Liang --- .../security/action/onbehalf/CreateOnBehalfOfTokenAction.java | 2 +- .../org/opensearch/security/http/OnBehalfOfAuthenticator.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/opensearch/security/action/onbehalf/CreateOnBehalfOfTokenAction.java b/src/main/java/org/opensearch/security/action/onbehalf/CreateOnBehalfOfTokenAction.java index 4a9c1b5b80..7e276b9e48 100644 --- a/src/main/java/org/opensearch/security/action/onbehalf/CreateOnBehalfOfTokenAction.java +++ b/src/main/java/org/opensearch/security/action/onbehalf/CreateOnBehalfOfTokenAction.java @@ -110,7 +110,7 @@ public void accept(RestChannel channel) throws Exception { try { if (vendor == null) { channel.sendResponse( - new BytesRestResponse(RestStatus.SERVICE_UNAVAILABLE, "on_behalf_of configuration is not being configured") + new BytesRestResponse(RestStatus.SERVICE_UNAVAILABLE, "on_behalf_of is either disabled or the configuration is invalid") ); return; } diff --git a/src/main/java/org/opensearch/security/http/OnBehalfOfAuthenticator.java b/src/main/java/org/opensearch/security/http/OnBehalfOfAuthenticator.java index 26c9a1fc62..fb894c5ffc 100644 --- a/src/main/java/org/opensearch/security/http/OnBehalfOfAuthenticator.java +++ b/src/main/java/org/opensearch/security/http/OnBehalfOfAuthenticator.java @@ -211,8 +211,8 @@ private AuthCredentials extractCredentials0(final RestRequest request) { } final String issuer = claims.getIssuer(); - final String clusterID = OpenSearchSecurityPlugin.getClusterName().getClusterName().value(); - if (!issuer.equals(clusterID)) { + final String clusterName = OpenSearchSecurityPlugin.getClusterName().getClusterName().value(); + if (!issuer.equals(clusterName)) { log.error("This issuer of this OBO does not match the current cluster identifier"); return null; }