Skip to content

Commit

Permalink
update sample
Browse files Browse the repository at this point in the history
  • Loading branch information
brockallen committed Apr 12, 2019
1 parent 9dcd487 commit 50a603f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions samples/VanillaJS/public/code-identityserver-sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
Expand All @@ -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 () {
Expand Down

0 comments on commit 50a603f

Please sign in to comment.