Skip to content

Instantly share code, notes, and snippets.

@alx-andru
Last active October 30, 2018 13:08
Show Gist options
  • Save alx-andru/daf563e244f4a2cd2bb1fd5175eb3a3b to your computer and use it in GitHub Desktop.
Save alx-andru/daf563e244f4a2cd2bb1fd5175eb3a3b to your computer and use it in GitHub Desktop.
Example callback.html to be used with ng-oidc-client
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Callback</title>
<link rel="icon"
type="image/x-icon"
href="favicon.png">
<script src="oidc-client.min.js"
type="application/javascript"></script>
</head>
<body>
<script>
var Oidc = window.Oidc;
var isPopupCallback = JSON.parse(window.localStorage.getItem('ngoidc:isPopupCallback'));
if (isPopupCallback) {
new Oidc.UserManager().signinPopupCallback();
} else {
new Oidc.UserManager().signinRedirectCallback().then(t => {
window.location.href = user.state.redirect_url || '/'; });
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment