<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D51Y00009QZg2xSADOkta Classic EngineLifecycle ManagementAnswered2024-04-16T12:18:30.000Z2020-09-16T14:31:26.000Z2020-09-23T15:47:39.000Z

da1cw (da1cw) asked a question.

Token renewal not working

I need to renew my token automatically after it expires. I followed the instructions provided on the following link:

 

https://support.okta.com/help/s/article/How-does-the-Auto-Renewal-of-tokens-work-in-Auth-JS?language=en_US

 

I configured the autoRenew property in the token manager as true:

 

tokenManager: {

            autoRenew: true

     },

 

I coded the expired function like this:

 

window.signInWidget.authClient.tokenManager.on('expired', function (key, expiredToken) {

    debugger;

    console.log('Token with key', key, ' has expired:');

    console.log(expiredToken);

});

And the renewed function is coded like this:

 

window.signInWidget.authClient.tokenManager.on('renewed', function (key, newToken, oldToken) {

    debugger;

    AuthenticationToken.set(newToken);

    console.log('Old token:', oldToken);

    console.log('New token:', newToken);

});

 

The problem that I have is that only the expired function is called when the token expires, but the renewed function is never called.

 

How can I make the renewed call work?


This question is closed.
Loading
Token renewal not working