问题
I am trying to use a rest API for authentication in my outlook add-in but it is being redirected to a separate browser window instead of rendering in the Iframe and control never comes back.
回答1:
Because of security constraints you cannot implement the OAUTH flow within the addin sandboxed iFrame, so the popup window is a necessary workaround.
Here is the best solution to achieve the OAUTH flow in popup.
Microsoft is well aware of the problem and has started to work on a dialogAPI that avoid popup window (that may be turned off).
EDIT (September 2016):
At Keluro we released an open source code sample to leverage the sign-in technicalities. It is used more for connecting to Azure AD/Office 365 but the client side using dialogApi and the popup as a fall back can be reused
来源:https://stackoverflow.com/questions/38828606/how-to-open-the-url-for-authentication-inside-the-iframe