Trigger updateToken
See original GitHub issueThanks for this helpful plugin.
I understand that there is an implicit token refresh, but I would like to trigger updateToken()
before making an API call (or) as a part of error handling of an 403 response, like how it’s mentioned in the JS adapter docs. How do I do this?
I did try $keycloak.updateToken but this function is not exposed with the $keycloak instance. Is there any other way? Thanks in advance!
keycloak.updateToken(60).then(function() {
makeAPICall();
}).catch(function() {
alert('Failed to refresh token');
});
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
KEYCLOAK - Refresh/update token not working - Stack Overflow
In your code You never see the token refreshed because the refresh is never triggered in the 15 seconds window in which will...
Read more >Refresh the token at some fixed interval rather than ... - GitHub
Can we have simple solution to set the minValidity as a prop in config and then use it for triggering the updateToken method....
Read more >Update token after updating user info - Auth0 Community
When updating the currently logged in user information in our application, we are successfully sending the new information to Auth0, ...
Read more >keycloak.js - 400 on token refresh after a long period of ...
... js app - all calls trigger a call within Keycloak refresh token get 400. ... token has actually expired and hence the...
Read more >Using the refresh token - Amazon Cognito - AWS Documentation
As a best practice, applications should redirect users to the logout endpoint to force the browser to clear session cookies. An application can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If updateToken() from the Keycloak JS adapter is the only thing that’ll help, I guess this function also has to be exposed.
I’m wondering if it’s better to just expose the whole Keycloak object altogether, acting like a proxy, so every function/property is exposed always…
@CryptoZorro this should now be possible with version 1.3.1+ by doing Vue.$keycloak.keycloak.updateToken(60)