Last active
October 30, 2018 13:08
-
-
Save alx-andru/daf563e244f4a2cd2bb1fd5175eb3a3b to your computer and use it in GitHub Desktop.
Example callback.html to be used with ng-oidc-client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!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