Force JWT refresh after modifying app metadata included in token

Hi,

I am trying to link between application account and auth0 accounts so that the generated auth0 token will include a reference I need. However this reference is only added upon creation meaning that the currently active token will not contain it even though the token is valid. I am wondering if there is a way that I can force the token to regenerate so that subsequent calls will use a token that includes the newly added reference.

My implementation has a restriction that means that I cannot have Auth0 kick this all off as an hook so that rules out pre or post sign-up calls.

Requirements:

  1. When the user attempts to use my app a user is created on our systems for it and the reference is then passed to auth0 in the app metadata
  2. There is a rule active which will add the reference mentioned above into the token (however this will not be part of already created tokens which seem to not time out for x amount of time)

I have seen a similar question on the forums but am unsure if it would work for my needs:

Would appreciate any recommendations or extra information anyone could provide around forcing a switch to a newly generated token preferably silently so that the user does not know that the token has been regenerated (they don’t need to re-login)

Thanks in advance for any help!

Hi @clee,

Welcome to the Community!

You can use the ignoreCache option to force a new token refresh. Checkout the doc for it:

https://auth0.github.io/auth0-spa-js/interfaces/gettokensilentlyoptions.html#ignorecache

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.