Keycloak js adapter update/renew/refresh token expiration time or token?

keycloak-js": “^9.0.1”

I have react-app authentication through keycloak keycloak.init({ onLoad: ‘check-sso’, checkLoginIframe: false, useNonce: false })

How do I refresh token or extent renew expiration time in the token “exp”?
I tried keycloak.updateToken() but “exp” stays the same no mater what.


keycloak.updateToken(900).success(function(refreshed) {
if (refreshed) {
console.log('tokenParsed ', keycloak.tokenParsed);
console.log('refreshTokenParsed ', keycloak.refreshTokenParsed);
} else {
console.log(‘Token not refreshed, valid for ’ + Math.round(keycloak.tokenParsed.exp + keycloak.timeSkew - new Date().getTime() / 1000) + ’ seconds’);
}).error(function() {
console.log(‘Failed to refresh token’);

tokenParsed {jti: “ea417b9a-3cee-464d-8065-753b1de00905”, exp: 1589921465, nbf: 0, iat: 1589921191, iss: “https://localhost/auth/realms/sapience-realm”, …}
refreshTokenParsed {jti: “8dab1d24-bf4c-4c7d-bb5c-74639cc2388f”, exp: 1589921465, nbf: 0, iat: 1589921191, iss: “https://localhost/auth/realms/sapience-realm”, …}

I can see tokenParsed and refreshTokenParsed has the same exp: value, jti: value is different. Am I doing something wrong?