[keycloak-dev] Calling JavaScript keycloak.init() with token/refresh token leads to broken keycloak.update()

Alexander Schwartz alexander.schwartz at gmx.net
Thu Jan 14 23:35:56 EST 2016


Hello developers,

I am pre-initializing JavaScript keycloak with tokens like this:

keycloak.init({
         token: getSetting('token'),
         refreshToken: getSetting('refreshToken'),
         idToken: getSetting('idToken')
     })

I found that the keyclock.update() didn't update any tokens, as the 
property timeSkew was left uninitialized.

I've created https://issues.jboss.org/browse/KEYCLOAK-2322 and a Pull 
Request https://github.com/keycloak/keycloak/pull/2032 that worked for 
me both in 1.7.0 and 1.8.CR1

timeSkew can now also be passed as a parameter to the init options with 
a default of 0.

As timeSkew needs to be set every time setToken is being called, I 
wonder if I should refactor the code to add a timeSkew to the signature 
of setToken(). Should this be done as part of this ticket, in in another 
ticket?

I'm also missing a place where to put some tests for this. Where would I 
find the test suite for this?

Thanks, Alexander.


-- 
Alexander Schwartz (alexander.schwartz at gmx.net)
http://www.ahus1.de



More information about the keycloak-dev mailing list