oauth2
oauth2 copied to clipboard
Configurable per-token expiration?
Hello,
We've been testing this library for a future project but there are a few things that we'd need to add:
- The ability to configure a separate expiration duration on a per-token basis.
- The ability to configure a
0
duration that means the tokens never expire.
Would you have any objection to us creating a PR to implement these? The 0
duration seems relatively straightforward, for the per-token expiration, I was thinking we'd add support for configuring a function much like SetInternalErrorHandler
that would be called on token minting and would return a Duration.
What do you think?
Thanks
Hello, I agree with your request and look forward to your PR.
However, in accordance with your needs, you need to make changes to the token's storage interface and implementation.
maybe you can use AccessTokenExpHandler
.