diff --git a/token/src/main/java/com/networknt/oauth/token/handler/Oauth2TokenPostHandler.java b/token/src/main/java/com/networknt/oauth/token/handler/Oauth2TokenPostHandler.java index 67a2f7f3..e2e6749f 100644 --- a/token/src/main/java/com/networknt/oauth/token/handler/Oauth2TokenPostHandler.java +++ b/token/src/main/java/com/networknt/oauth/token/handler/Oauth2TokenPostHandler.java @@ -583,7 +583,7 @@ private JwtClaims mockCcClaims(String clientId, String scopeString, Map formMap) { + private JwtClaims mockAcClaims(String clientId, String scopeString, String userId, String userType, String roles, String csrf, Map formMap) { JwtClaims claims = JwtIssuer.getDefaultJwtClaims(); claims.setClaim("user_id", userId); claims.setClaim("user_type", userType); @@ -593,9 +593,8 @@ private JwtClaims mockAcClaims(String clientId, String scopeString, String userI List scope = Arrays.asList(scopeString.split("\\s+")); claims.setStringListClaim("scope", scope); // multi-valued claims work too and will end up as a JSON array } - if(roleString != null && roleString.trim().length() > 0) { - List roles = Arrays.asList(roleString.split("\\s+")); - claims.setStringListClaim("roles", roles); // multi-valued claims work too and will end up as a JSON array + if(roles != null && roles.trim().length() > 0) { + claims.setClaim("roles", roles); } if(formMap != null) {