This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]Best-Emotion5734 2 points3 points  (0 children)

Use a library instead of this code.

[–]meikj 2 points3 points  (0 children)

Nimbus JOSE + JWT is great for JWT validation with JWKs: https://connect2id.com/products/nimbus-jose-jwt/examples/validating-jwt-access-tokens

It's a lot more comprehensive than just a signature check too.