diff --git a/src/main/java/org/opensearch/security/authtoken/jwt/JwtVendor.java b/src/main/java/org/opensearch/security/authtoken/jwt/JwtVendor.java index 4372e2dfee..0b9154a09b 100644 --- a/src/main/java/org/opensearch/security/authtoken/jwt/JwtVendor.java +++ b/src/main/java/org/opensearch/security/authtoken/jwt/JwtVendor.java @@ -152,7 +152,7 @@ public String createJwt( if (bwcModeEnabled && backendRoles != null) { String listOfBackendRoles = String.join(",", backendRoles); - jwtClaims.setProperty("dbr", listOfBackendRoles); + jwtClaims.setProperty("br", listOfBackendRoles); } String encodedJwt = jwtProducer.processJwt(jwt); diff --git a/src/main/java/org/opensearch/security/http/OnBehalfOfAuthenticator.java b/src/main/java/org/opensearch/security/http/OnBehalfOfAuthenticator.java index fb894c5ffc..23d3bb6d75 100644 --- a/src/main/java/org/opensearch/security/http/OnBehalfOfAuthenticator.java +++ b/src/main/java/org/opensearch/security/http/OnBehalfOfAuthenticator.java @@ -104,11 +104,11 @@ private List extractSecurityRolesFromClaims(Claims claims) { private String[] extractBackendRolesFromClaims(Claims claims) { // Object backendRolesObject = ObjectUtils.firstNonNull(claims.get("ebr"), claims.get("dbr")); - if (!claims.containsKey("dbr")) { + if (!claims.containsKey("br")) { return null; } - Object backendRolesObject = claims.get("dbr"); + Object backendRolesObject = claims.get("br"); String[] backendRoles; if (backendRolesObject == null) {