You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2020/02/10 16:37:49 UTC

[GitHub] [knox] pzampino commented on a change in pull request #260: KNOX-2228 - JWTFilter should handle unknown token exception from toke…

pzampino 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_r377177657
 
 

 ##########
 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:
   I've been debating the need for an UnknownTokenException, and your comment may have just convinced me to implement it.

----------------------------------------------------------------
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


With regards,
Apache Git Services