Skip to content

Commit

Permalink
Change the backendrole check's claim name into br
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <[email protected]>
  • Loading branch information
RyanL1997 committed Aug 22, 2023
1 parent b2c7d75 commit 1f12e5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ private List<String> 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) {
Expand Down

0 comments on commit 1f12e5e

Please sign in to comment.