You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by GitBox <gi...@apache.org> on 2021/01/19 14:59:24 UTC

[GitHub] [geronimo-jwt-auth] dabloem commented on a change in pull request #5: alternative group claim

dabloem commented on a change in pull request #5:
URL: https://github.com/apache/geronimo-jwt-auth/pull/5#discussion_r560239630



##########
File path: src/main/java/org/apache/geronimo/microprofile/impl/jwtauth/servlet/JwtRequest.java
##########
@@ -132,6 +139,20 @@ public Principal getUserPrincipal() {
 
     @Override
     public boolean isUserInRole(final String role) {
+        if (tokenExtractor.get().containsClaim(groupsName)) {
+            JsonValue jsonValue = tokenExtractor.get().getClaim(groupsName);
+            Set<String> groups = Collections.EMPTY_SET;
+            if (jsonValue.getValueType() == JsonValue.ValueType.ARRAY) {
+                groups = JsonArray.class.cast(jsonValue).stream()

Review comment:
       done




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org