From 9b8c80e83fef593152e406372e97eefaabb11878 Mon Sep 17 00:00:00 2001 From: Alexander Schwartz Date: Thu, 14 Jan 2016 22:34:44 +0100 Subject: [PATCH] set timeSkew when passing tokens to init(), also allow timeSkew to be passed as a parameter / KEYCLOAK-2322 --- .../reference/en/en-US/modules/javascript-adapter.xml | 2 ++ integration/js/src/main/resources/keycloak.js | 1 + 2 files changed, 3 insertions(+) diff --git a/docbook/auth-server-docs/reference/en/en-US/modules/javascript-adapter.xml b/docbook/auth-server-docs/reference/en/en-US/modules/javascript-adapter.xml index ab7896d7c4..88d7f047b6 100755 --- a/docbook/auth-server-docs/reference/en/en-US/modules/javascript-adapter.xml +++ b/docbook/auth-server-docs/reference/en/en-US/modules/javascript-adapter.xml @@ -234,6 +234,8 @@ new Keycloak({ url: 'http://localhost/auth', realm: 'myrealm', clientId: 'myApp' onLoad - specifies an action to do on load, can be either 'login-required' or 'check-sso' token - set an initial value for the token refreshToken - set an initial value for the refresh token + idToken - set an initial value for the id token (only together with token or refreshToken) + timeSkew - set an initial value for skew between local time and Keycloak server in seconds (only together with token or refreshToken) checkLoginIframe - set to enable/disable monitoring login state (default is true) checkLoginIframeInterval - set the interval to check login state (default is 5 seconds) responseMode - set the OpenID Connect response mode send to Keycloak server at login request. Valid values are query or fragment . diff --git a/integration/js/src/main/resources/keycloak.js b/integration/js/src/main/resources/keycloak.js index a74e1ccae7..928ed691a5 100755 --- a/integration/js/src/main/resources/keycloak.js +++ b/integration/js/src/main/resources/keycloak.js @@ -129,6 +129,7 @@ } else if (initOptions) { if (initOptions.token || initOptions.refreshToken) { setToken(initOptions.token, initOptions.refreshToken, initOptions.idToken, false); + kc.timeSkew = initOptions.timeSkew || 0; if (loginIframe.enable) { setupCheckLoginIframe().success(function() {