Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.1.35 introduced a new issue in the jwt verification #2321

Closed
stevehu opened this issue Aug 21, 2024 · 0 comments
Closed

2.1.35 introduced a new issue in the jwt verification #2321

stevehu opened this issue Aug 21, 2024 · 0 comments

Comments

@stevehu
Copy link
Contributor

stevehu commented Aug 21, 2024

If the token is for other API and the http-proxy cannot get the jwk based on the kid, it throws a runtime exception and bubble up to the exception handler. The consumer will receive a 500 error instead of 400 error. It needs to be handled gracefully.

Here is the stack trace.

ERROR c.n.exception.ExceptionHandler:79 handleRequest - Exception:
java.lang.RuntimeException: no JWK for kid: YW45heiZJIz8y64BeDOu5a6v49RkpRMfn42qc8Vdy2E
  at com.networknt.security.JwtVerifier.getKeyResolver(JwtVerifier.java:524)
  at com.networknt.security.JwtVerifier.verifyJwt(JwtVerifier.java:285)
  at com.networknt.security.JwtVerifier.verifyJwt(JwtVerifier.java:193)
  at com.networknt.security.AbstractJwtVerifyHandler.handleJwt(AbstractJwtVerifyHandler.java:99)
  at com.networknt.security.UnifiedSecurityHandler.verifyUnifiedSecurity(UnifiedSecurityHandler.java:229)
  at com.networknt.security.UnifiedSecurityHandler.handleRequest(UnifiedSecurityHandler.java:55)
  at com.networknt.handler.Handler.next(Handler.java:211)
  at com.networknt.handler.Handler.next(Handler.java:231)
  at com.networknt.openapi.OpenApiHandler.handleRequest(OpenApiHandler.java:251)
  at com.networknt.handler.Handler.next(Handler.java:211)
  at com.networknt.handler.Handler.next(Handler.java:231)
  at com.networknt.router.SidecarRouterHandler.handleRequest(SidecarRouterHandler.java:78)
  at com.networknt.handler.Handler.next(Handler.java:211)
  at com.networknt.handler.Handler.next(Handler.java:231)
  at com.networknt.audit.AuditHandler.next(AuditHandler.java:200)
  at com.networknt.audit.AuditHandler.handleRequest(AuditHandler.java:188)
  at com.networknt.handler.Handler.next(Handler.java:229)
  at 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant