diff --git a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/ClaimBean.java b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/ClaimBean.java index be83a9b3890..f36405b4fc9 100644 --- a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/ClaimBean.java +++ b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/ClaimBean.java @@ -256,6 +256,11 @@ public Object get() { // handle JsonValue (number, string, etc) return (T) toJson(key); + } else if (((Class) ip.getType()).isEnum()) { + try { + return (T) ((Class) ip.getType()).getMethod("valueOf", String.class).invoke(null, getClaimValue(key).toString()); + } catch (Exception e) { + } } else { // handle Raw types return getClaimValue(key);