From dcde654ebd5a1dcbf2173b884c957a4e148af246 Mon Sep 17 00:00:00 2001 From: pamapa Date: Wed, 24 Nov 2021 18:44:20 +0100 Subject: [PATCH] feat: extend Parcel with revoke access token --- .../src/code-flow-identityserver/sample.html | 1 + .../src/code-flow-identityserver/sample.js | 25 +++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/samples/Parcel/src/code-flow-identityserver/sample.html b/samples/Parcel/src/code-flow-identityserver/sample.html index 4e76531d5..f4c7eb823 100644 --- a/samples/Parcel/src/code-flow-identityserver/sample.html +++ b/samples/Parcel/src/code-flow-identityserver/sample.html @@ -14,6 +14,7 @@ +
diff --git a/samples/Parcel/src/code-flow-identityserver/sample.js b/samples/Parcel/src/code-flow-identityserver/sample.js index fb768fbcb..b02891e83 100644 --- a/samples/Parcel/src/code-flow-identityserver/sample.js +++ b/samples/Parcel/src/code-flow-identityserver/sample.js @@ -10,6 +10,7 @@ document.getElementById("clearState").addEventListener("click", clearState, fals document.getElementById("getUser").addEventListener("click", getUser, false); document.getElementById("removeUser").addEventListener("click", removeUser, false); document.getElementById("querySessionStatus").addEventListener("click", querySessionStatus, false); +document.getElementById("revokeAccessToken").addEventListener("click", revokeAccessToken, false); document.getElementById("startSigninMainWindow").addEventListener("click", startSigninMainWindow, false); document.getElementById("endSigninMainWindow").addEventListener("click", endSigninMainWindow, false); @@ -114,6 +115,22 @@ function removeUser() { }); } +function querySessionStatus() { + mgr.querySessionStatus().then(function(status) { + log("user's session status", status); + }).catch(function(err) { + log(err); + }); +} + +function revokeAccessToken() { + mgr.revokeAccessToken().then(function() { + log("access token revoked"); + }).catch(function(err) { + log(err); + }); +} + function startSigninMainWindow() { mgr.signinRedirect(/*{useReplaceToNavigate:true}*/).then(function() { log("signinRedirect done"); @@ -158,14 +175,6 @@ function iframeSignin() { }); } -function querySessionStatus() { - mgr.querySessionStatus().then(function(status) { - log("user's session status", status); - }).catch(function(err) { - log(err); - }); -} - function startSignoutMainWindow() { mgr.signoutRedirect().then(function(resp) { log("signed out", resp);