
Our D365 app presents an iframe on a form which loads another website (different domain) which conducts some Q and A then returns to a 'completed' page which is a D365 webresource html page.
This works most of the time but occasionally we see 'login.microsoftonline.com refused to connect' and in dev tools the error 'Refused to display 'https://login.microsoftonline.com' in a frame because it set 'x-frame-options' to 'deny'.
I could understand if this happens ALL the time but it doesn't - more often than not, it works! Once I see the error, it persists until I log out/in again.
Following the error, I still appear to be logged in and can happily navigate in D365.
Any suggestions greatly appreciated.
It seems that the OAuth 2.0 acces tokens expire and are renewed in the background but this won't apply to the iframe so attempts to redirect fail as we are no longer logged in. We reworked our code so the iframe uses html5 window.parent.postMessage, rather than attempting to redirect to a D365 webresource.