lmccay commented on a change in pull request #427:
URL: https://github.com/apache/knox/pull/427#discussion_r605728662
##########
File path:
gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/AbstractJWTFilter.java
##########
@@ -385,12 +387,18 @@ protected boolean validateToken(final HttpServletRequest
request,
if (tokenStateService != null) {
try {
- if (tokenIsStillValid(tokenId)) {
- return true;
+ if (tokenId != null) {
+ if (tokenIsStillValid(tokenId)) {
+ return true;
+ } else {
+ log.tokenHasExpired(Tokens.getTokenIDDisplayText(tokenId));
+ handleValidationError(request, response,
HttpServletResponse.SC_BAD_REQUEST,
+ "Bad request: token has expired");
+ }
} else {
- log.tokenHasExpired(Tokens.getTokenIDDisplayText(tokenId));
+ log.missingTokenPasscode();
handleValidationError(request, response,
HttpServletResponse.SC_BAD_REQUEST,
- "Bad request: token has expired");
Review comment:
okay.
--
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]