oauth2 icon indicating copy to clipboard operation
oauth2 copied to clipboard

Configurable per-token expiration?

Open dmcinnes opened this issue 5 years ago • 2 comments

Hello,

We've been testing this library for a future project but there are a few things that we'd need to add:

  1. The ability to configure a separate expiration duration on a per-token basis.
  2. 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

dmcinnes avatar Aug 09 '19 23:08 dmcinnes

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.

LyricTian avatar Aug 14 '19 06:08 LyricTian

maybe you can use AccessTokenExpHandler.

sfwn avatar Mar 22 '20 10:03 sfwn