[ 
https://issues.apache.org/jira/browse/KNOX-2228?focusedWorklogId=384473&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-384473
 ]

ASF GitHub Bot logged work on KNOX-2228:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Feb/20 15:34
            Start Date: 10/Feb/20 15:34
    Worklog Time Spent: 10m 
      Work Description: risdenk commented on 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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 384473)
    Time Spent: 20m  (was: 10m)

> JWTFilter should handle unknown token exception from token state service
> ------------------------------------------------------------------------
>
>                 Key: KNOX-2228
>                 URL: https://issues.apache.org/jira/browse/KNOX-2228
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 1.4.0
>            Reporter: Philip Zampino
>            Assignee: Philip Zampino
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> When server-managed token state is enabled, and the JWT filters check if the 
> token is still valid, it should not throw the exception since it results in a 
> HTTP 500 response.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to