risdenk commented on a change in pull request #260: KNOX-2228 - JWTFilter 
should handle unknown token exception from toke…
URL: https://github.com/apache/knox/pull/260#discussion_r377135229
 
 

 ##########
 File path: 
gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/AbstractJWTFilter.java
 ##########
 @@ -170,7 +170,13 @@ protected void configureExpectedParameters(FilterConfig 
filterConfig) {
   protected boolean tokenIsStillValid(JWT jwtToken) {
     Date expires;
     if (tokenStateService != null) {
-      expires = new 
Date(tokenStateService.getTokenExpiration(jwtToken.toString()));
+      long timestamp = 0;
+      try {
+        timestamp = tokenStateService.getTokenExpiration(jwtToken.toString());
+      } catch (Exception e) {
 
 Review comment:
   Do we not have a specific exception coming from getTokenExpiration? or 
tokenStateService?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to