Skip to content

How to verify decoded token #625

Answered by panva
jonaskello asked this question in Q&A
Jan 8, 2024 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

The reason I'm looking to minimize parsing is that this code is called on every request. My thinking is that skipping the extra parsing, even if it has minimal impact when run once, may have some significance if there are many requests.

You're focusing entirely on the wrong optimization. What you want to focus on instead is ensuring that you're using a trusted jwksUri and then caching the result of createRemoteJWKSet, using the jwksUri as the cache key.

Trusting any jwksUri is clearly a problem, you need to have an allow list or somehow ensure you want to accept a specific URL.

even if it has minimal impact when run once

It has a minimal impact even when run tons of times.

So you wou…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jonaskello
Comment options

@jonaskello
Comment options

@panva
Comment options

panva Jan 8, 2024
Maintainer

Answer selected by jonaskello
@jonaskello
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants