从Excel联机任务窗格访问window.open弹出窗口 [英] Accessing window.open popup from excel online task pane

查看:69
本文介绍了从Excel联机任务窗格访问window.open弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在调试一些以前的开发人员编写的代码. 我们正在使用以下代码打开一个新窗口来验证用户身份(oAuth2 Flow).

I am currently debugging some code that was done by past developers. We are using the below code to open a new window to authenticate the user (oAuth2 Flow).

var oAuth2Window = window.open(_embeddedStartUrl,"Authentication", "location = 0,status = 0,scrollbars = 1,reizableizable = 1,height = 600,width = 450");

var oAuth2Window = window.open(_embeddedStartUrl, "Authentication", "location=0,status=0,scrollbars=1,resizable=1,height=600,width=450");

用户成功登录后,它正在尝试访问oAuth2Window上的某些属性,但是我得到了:

After the user logs in successfully, it's trying to access some properties on oAuth2Window but I am getting:

访问被拒绝".

"Access is denied".

主机名位于不同的服务器上.

The host names are on different servers.

这当前在Excel Online中的任务窗格中发生.

This is currently happening in Excel Online within a Task Pane.

这是经过一段时间测试的,可以正常工作并投入生产.

This was tested some time ago and was working and went to production.

过去一周,我看到此问题在本地和生产/现场环境中发生.

The past week I have seen this issue happening on local and production/live environments.

这以前如何工作?知道您无法从iframe

How could this worked previously? Knowing that you could not access the pop up window from an iframe

推荐答案

您将无法在不同的客户端应用程序中使用此方法执行此操作.相反,您需要通过对话框API窗口路由OAuth工作流程.

You won't be able to do this using this method from your different client applications. Instead you need to route you OAuth workflow through the dialog API window.

在此处查看此链接使用身份验证流程中的Dialog API (在页面底部附近).

See this link here Using the Dialog APIs in an authentication flow (near the bottom of the page).

这篇关于从Excel联机任务窗格访问window.open弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆