【问题标题】:Error #Unhandled securityError accessing https://accounts.google.com错误 #Unhandled securityError 访问 https://accounts.google.com
【发布时间】:2014-02-28 00:55:39
【问题描述】:

我正在尝试为 AS3 编写一个随处使用(网络、空中、移动)OAuth 库,该库足够灵活,可以与任何 OAuth 站点或 OAuth 附近的站点一起使用。 我正在编写的示例应用程序通过 Google 进行身份验证,我想编写一个使用 google drive 的应用程序。

目前 Air 和移动应用程序运行良好,但网络 Flash 播放器应用程序不断给我这个错误:

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://localhost:81/OAuthWebExample.swf cannot load data from https://accounts.google.com/o/oauth2/token.

(我在端口 80 上的非本地域域上遇到相同的错误)

我查看了https://accounts.google.com/crossdomain.xml,其中有:

<site-control permitted-cross-domain-policies="by-content-type" />

我不确定这意味着什么......

我很确定可以让 Flash 与这些 google API 对话。我该怎么做才能让它发挥作用?

(我对你使用 feedburner 或类似代理这些调用的“工作回合”不感兴趣)。

【问题讨论】:

    标签: actionscript-3 flash oauth-2.0 google-oauth


    【解决方案1】:

    我看过https://accounts.google.com/crossdomain.xml

    这是主策略文件,它不授予对accounts.google.com域内容的权限(没有allow-access-from节点),所以flash player会触发securityError

    我不确定这意味着什么......

    It means:

    按内容类型:[仅限 HTTP/HTTPS] 仅提供策略文件 Content-Type: text/x-cross-domain-policy are allowed

    所以它似乎是为子域服务和子crossdomain.xml 文件设计的,所以你不能直接从accounts.google.com 加载数据。我发现Google OAuth 与闪存Google Oauth crossdomain.xml problem with Flex 存在相同的问题,他们必须使用旧的AuthSub(它使用accounts.googleapis.com 和适当的crossdomain.xml)来解决身份验证问题,过去两个似乎没有任何改变年。

    【讨论】:

      【解决方案2】:

      在编译时检查 Flash 播放器的安全性,无论是本地的还是外部的。

      AIR 应用程序可以连接到外部和本地文件,但嵌入式 swf 不能这样做

      https://www.adobe.com/security/flashplayer/articles/localcontent/

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-02-21
        • 2012-08-19
        • 1970-01-01
        • 1970-01-01
        • 2021-04-16
        • 2022-01-09
        • 1970-01-01
        相关资源
        最近更新 更多