Skip to content

Instantly share code, notes, and snippets.

@imeanitworks
Last active November 16, 2016 23:57
Show Gist options
  • Select an option

  • Save imeanitworks/8e09f8be9a962e36868e9277da777c88 to your computer and use it in GitHub Desktop.

Select an option

Save imeanitworks/8e09f8be9a962e36868e9277da777c88 to your computer and use it in GitHub Desktop.
This is the generic callback page that you can use to process the oauth redirect tokens
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<h1 id="waiting">Waiting...</h1>
<div id="error"></div>
<script type="text/javascript" src="oidc-client.min.js"></script>
<script>
new Oidc.UserManager().signinRedirectCallback().then(function (user) {
if (user == null) {
document.getElementById("waiting").style.display = "none";
document.getElementById("error").innerText = "No sign-in request pending.";
}
else {
var path= window.location.pathname;
path = path.substring(0, path.lastIndexOf("/") + 1);
window.location = path;
}
})
.catch(function (er) {
document.getElementById("waiting").style.display = "none";
document.getElementById("error").innerText = er.message;
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment