tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From radcor...@apache.org
Subject [tomee] 08/12: logging and minor fixes
Date Fri, 04 Jan 2019 13:30:57 GMT
This is an automated email from the ASF dual-hosted git repository.

radcortez pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 66a42016730b113dedea0a17f0427d0eab3d4e98
Author: ivanjunckes <ijunckes@tomitribe.com>
AuthorDate: Thu Jan 3 13:05:52 2019 -0200

    logging and minor fixes
---
 .../main/java/org/apache/tomee/microprofile/jwt/cdi/ClaimBean.java   | 2 +-
 .../org/apache/tomee/microprofile/jwt/config/JWTAuthContextInfo.java | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

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 2476cbc..7e6a758 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
@@ -274,7 +274,7 @@ public class ClaimBean<T> implements Bean<T>, PassivationCapable
{
         }
 
         JsonWebToken jsonWebToken = null;
-        if (! JsonWebToken.class.isInstance(principal)) {
+        if (!JsonWebToken.class.isInstance(principal)) {
             logger.warning(String.format("Can't retrieve claim %s. Active principal is not
a JWT.", name));
             return null;
         }
diff --git a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/config/JWTAuthContextInfo.java
b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/config/JWTAuthContextInfo.java
index 4cfa333..447cb2f 100644
--- a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/config/JWTAuthContextInfo.java
+++ b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/config/JWTAuthContextInfo.java
@@ -16,6 +16,7 @@
  */
 package org.apache.tomee.microprofile.jwt.config;
 
+import org.apache.tomee.microprofile.jwt.cdi.MPJWTCDIExtension;
 import org.jose4j.jwk.JsonWebKey;
 import org.jose4j.lang.JoseException;
 
@@ -23,12 +24,14 @@ import java.security.Key;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.logging.Logger;
 import java.util.stream.Collectors;
 
 /**
  * The public key and expected issuer needed to validate a token.
  */
 public class JWTAuthContextInfo {
+    private static final Logger logger = Logger.getLogger(MPJWTCDIExtension.class.getName());
     public static final String DEFAULT_KEY = "DEFAULT";
 
     private Map<String, Key> signerKeys;
@@ -73,7 +76,7 @@ public class JWTAuthContextInfo {
                 jsonWebKey.setKeyId(key.getKey());
                 return jsonWebKey;
             } catch (final JoseException e) {
-                e.printStackTrace();
+                logger.warning(e.getMessage());
                 return null;
             }
         }).collect(Collectors.toList());


Mime
View raw message