For those wondering on how to tackle this issue in angular 2, using the solution purposed here: https://gist.github.com/tushargupta51/5fa6d000357120adbc8fd1d5c68853c4#gistcomment-2596636 It's as simple as this
After creating the redirect.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Frame Redirect</title>
<script src="https://secure.aadcdn.microsoftonline-p.com/lib/1.0.17/js/adal.min.js"></script>
</head>
<body>
<script>
var adalConfig = {
clientId: "guid-goes-here"
};
var authContext = new AuthenticationContext(adalConfig);
authContext.handleWindowCallback();
if (window === window.parent) { window.location.replace(location.origin + location.hash); }
</script>
</body>
</html>
In your angular.json
add the following line
...
build: {
...
"assets": [
...
"src/redirect.html",
],
...
}
...
Don't forget to point the returnURI configuration over azure active directory to the new created /redirect.html
Thank you for this.
I notice that the iframe is lost when the user refreshes the page, do you know if it will be regenerated? It is a PITA to test!