From 50a603fa97596c6cc96c448d8640a30b0470278a Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Thu, 11 Apr 2019 22:43:31 -0400 Subject: [PATCH] update sample --- .../VanillaJS/public/code-identityserver-sample.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/samples/VanillaJS/public/code-identityserver-sample.js b/samples/VanillaJS/public/code-identityserver-sample.js index da5b9523..481ce6f1 100644 --- a/samples/VanillaJS/public/code-identityserver-sample.js +++ b/samples/VanillaJS/public/code-identityserver-sample.js @@ -31,7 +31,8 @@ var url = window.location.origin; var settings = { authority: 'https://demo.identityserver.io', - client_id: 'native.code', + client_id: 'spa', + //client_id: 'spa.short', redirect_uri: url + '/code-identityserver-sample.html', post_logout_redirect_uri: url + '/code-identityserver-sample.html', response_type: 'code', @@ -43,7 +44,7 @@ var settings = { popup_post_logout_redirect_uri: url + '/code-identityserver-sample-popup-signout.html', silent_redirect_uri: url + '/code-identityserver-sample-silent.html', - automaticSilentRenew:true, + automaticSilentRenew:false, //silentRequestTimeout:10000, filterProtocolClaims: true, @@ -58,6 +59,13 @@ var mgr = new Oidc.UserManager(settings); mgr.events.addAccessTokenExpiring(function () { console.log("token expiring"); log("token expiring"); + + // maybe do this code manually if automaticSilentRenew doesn't work for you + mgr.signinSilent().then(function(user) { + log("silent renew success", user); + }).catch(function(e) { + log("silent renew error", e.message); + }) }); mgr.events.addAccessTokenExpired(function () {