oidc-client-ts icon indicating copy to clipboard operation
oidc-client-ts copied to clipboard

Automatic token renew on id_token expiry

Open TheMaskedTurtle opened this issue 1 year ago • 3 comments

I have been trying to use automatic token renew function for the id_token, but I didn't figure how I could do it with the lib. It appears I should add in the client code the exact same mechanism that is already used in the triggering of the events AccessTokenExpiring and AccessTokenExpired.

So would it be possible to extend the automatic silent renew mechanism to the id_token ? Or at least add events IdTokenExpiring and IdTokenExpired, so that we can add custom handlers to these events ?

TheMaskedTurtle avatar Dec 14 '23 14:12 TheMaskedTurtle

The re-new process deals with the access token and its expiration time.

pamapa avatar Dec 15 '23 10:12 pamapa

Hi @pamapa,

Thanks for your quick answer.

Yes, my proposition would extend the current feature to id_token too. And trigger the renewal as soon as one of the tokens are expired. Or at least even if it doesn't trigger anything (i.e. not integrated in the automatic renew process) it would be additional events of UserManager that we could add handlers on, on the client side and decide whether to launch a renewal or not, out of the lib.

TheMaskedTurtle avatar Dec 15 '23 10:12 TheMaskedTurtle

You will need to hack something on your own. I do not plan to have that in this library. If you something light-way please let us know...

pamapa avatar Dec 15 '23 13:12 pamapa