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

Reative implementation of validation with remote JWKS fetch keys on every validations #1734

Open
jbreton opened this issue Jun 11, 2024 · 4 comments · May be fixed by #1815
Open

Reative implementation of validation with remote JWKS fetch keys on every validations #1734

jbreton opened this issue Jun 11, 2024 · 4 comments · May be fixed by #1815
Labels
type: improvement A minor improvement to an existing feature

Comments

@jbreton
Copy link
Contributor

jbreton commented Jun 11, 2024

Expected Behavior

Remote JWKS validation should be cached and fetched only when expired as defined by JwksSignatureConfiguration::getCacheExpiration

Actual Behaviour

Every time a JWT needs to be validated, the remote JWKS is fetched

Steps To Reproduce

No response

Environment Information

No response

Example Application

No response

Version

4.5.0

@jbreton
Copy link
Contributor Author

jbreton commented Jun 11, 2024

We updated to micronaut 4.5.0 this morning and removed our static jwks file (as described here) and observed that the JWKS url was fetched more often.

It seems that ReactiveJwksSignature did not implement a cache. Reference : JwksSignature.

@yibo-long
Copy link

+1, it seems there is no caching control for the reactive implementation. While nimbus implementation is logging errors: #1684

additionally, we noticed that using default micronaut-http-client will cause using a pool for the HttpClient, while it cause our tracing system to catch another confusing error as:

io.netty.channel.StacklessClosedChannelException
	at io.netty.channel.AbstractChannel$AbstractUnsafe.write(Object, ChannelPromise)(Unknown Source)

@rickysaltzer
Copy link

Hitting this same bug, would be nice to fix because I'm having issues downgrading from 4.5 due to a KSP bug.

@timsearle
Copy link
Contributor

This was impacting me and my teams too, would love some feedback on my pull request, #1815, here. There are some trade-offs discussed on the PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants