oidc-client
oidc-client copied to clipboard
Automatic token renewal with a maximum delay between 2 triggers
I am trying to prevent a session cookie to expire before the token are renewed. This could happen when the tokens have a longer TTL than the cookie session, then we can longer perform a silent renew of the tokens.
Is there a way to prevent that with the current API ?
Otherwise, would it be possible to add a new parameter in the OidcConfiguration to configure this maximum delay between 2 token renew processes ?
Hi @TheMaskedTurtle ,
Thank you for your issue. You can configure the behavior by using https://github.com/AxaFrance/oidc-client/blob/9f1f7f684a6b344f59221caf3e3a14faef73a6bc/packages/react-oidc/README.md?plain=1#L188 Property.
If your token expirer after 1000 seconds and you set it to 400 Your token will be refreh after 600 seconds.
Hi @guillaume-chervet,
Thanks for your quick answer :)
Indeed it will do the trick. But it requires to know the token duration before configuring the application which is not necessarily the case. That's why ideally this parameter would not depend on the token duration itself.
Hi @TheMaskedTurtle , i understand your need. I need to think because i do not know how to resolve this.