login.html (800B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Identity Provider Login</title> 5 <script type="application/javascript"> 6 window.onload = () => { 7 var xhr = new XMLHttpRequest(); 8 xhr.open("PUT", "https://example.com/.well-known/idp-proxy/idp.sjs?" + 9 window.location.hash.replace('#', '')); 10 xhr.onload = () => { 11 var isFramed = (window !== window.top); 12 var parent = isFramed ? window.parent : window.opener; 13 // Using '*' is cheating, but that's OK. 14 parent.postMessage('LOGINDONE', '*'); 15 var done = document.createElement('div'); 16 17 done.textContent = 'Done'; 18 document.body.appendChild(done); 19 20 if (!isFramed) { 21 window.close(); 22 } 23 }; 24 xhr.send(); 25 }; 26 </script> 27 </head> 28 <body> 29 <div>Logging in...</div> 30 </body> 31 </html>