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

Setting cache duration based on response from introspection endpoint #187

Open
SandroGlueck opened this issue Jan 3, 2024 · 1 comment
Assignees

Comments

@SandroGlueck
Copy link

We are currently using IdentityModel.AspNetCore.OAuth2Introspection in many applications, using a wrapped Keycloak as authorization server.
Some of our business cases are very time critical, therefore we want to enable caching of introspection results. However in an effort to improve performance while not sacrificing security, we have the requirement to cache introspection results for varying amounts of time.
In our case, the recommended cache time is generated on the authorization server and returned as an additional custom claim with the introspection result (based mainly on the token type).

I don't see a way in which this could be achieved with the current implementation, as there is no part between the introspection request and the creation of the cache entry, where custom code could be executed.

My current idea to solve this, would be to add a new event that is fired after the introspection request is done. We could then update the Cache Duration based on the response from our authorization server.

If this would be okay, and there is no other (better) solution, I could propose a PR.

@leastprivilege
Copy link
Contributor

Hi,

thanks! Feel free to propose a PR. Due to other priorities, we cannot guarantee we can process that quickly though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants