kotlin-multiplatform-oidc
kotlin-multiplatform-oidc copied to clipboard
[TokenStore] Support for proactive token refresh
trafficstars
Currently, TokenStore does not save expires_in nor received_at. By adding those it's possible to do proactive token refreshing, rather than only reactive (e.g after HTTP 401).
Providing a function like TokenRefreshHandler.performWithFreshTokens would add support for refreshing tokens automatically if they're about to expire and use existing ones if not. That would eventually provide another option to use the library and would reduce 401 requests on the given server.