5

我无法获取我的 Yahoo! 要运行的应用程序平台我一直被拒绝访问,即使他们的策略文件接受来自任何域的请求。

OK: Policy file accepted: http://social.yahooapis.com/crossdomain.xml
Error: Request for resource at http://social.yahooapis.com/v1/user/<user id>/profile?oauth_signature_method=HMAC-SHA1&lang=en-US&oauth_consumer_key=<key>&oauth_token=<long ass token>&oauth_version=1.0&format=json&oauth_nonce=<blah blah>&oauth_timestamp=1262846353&region=US&oauth_signature=<foo bar> by requestor from http://<my domain>/YOSSimple.swf is denied due to lack of policy file permissions.

网址顺便说一句,我编辑了一些东西,因为它有我的钥匙和东西。


链接到我正在尝试做的事情

http://developer.yahoo.com/flash/yos/
http://developer.yahoo.com/flash/yos/examples/simple/YOSSimple.fla

YOSSimple 实际上正确创建了 url,因为如果我在浏览器中键入它,系统会提示我是否要下载包含有关我的个人资料信息的文件。

但它只是不会在 Flash 中打开它。

4

4 回答 4

2

我猜它不会自动加载策略文件。你应该尝试使用 Security.loadPolicyFile("http://social.yahooapis.com/crossdomain.xml");

您是否安装了 webproxy,您可以使用它来监控究竟加载了哪些文件?我最喜欢的是Charles,但也有免费的 FF 插件,比如Httpfox

编辑:我想我知道出了什么问题。反过来就出错了,来自雅虎的 swf 正在尝试访问您的 swf,但没有正确的权限。你会尝试

Security.allowDomain( 'http://social.yahooapis.com/' );
于 2010-01-11T09:09:31.117 回答
0

一个简单的 WebProxy 将解决这个问题:

<?php
    // PHP Proxy
    // Loads a XML from any location. Used with Flash/Flex apps to bypass security restrictions
    // usage: proxy.php?url=http://mysite.com/myxml.xml

    $session = curl_init($_GET['url']);                    // Open the Curl session
    curl_setopt($session, CURLOPT_HEADER, false);          // Don't return HTTP headers
    curl_setopt($session, CURLOPT_RETURNTRANSFER, true);   // Do return the contents of the call
    $xml = curl_exec($session);                            // Make the call
    header("Content-Type: text/xml");                  // Set the content type appropriately
    echo $xml;        // Spit out the xml
    curl_close($session); // And close the session
?>
于 2010-11-08T13:04:35.080 回答
0

http://www.ieinspector.com/httpanalyzer/

使用 HTTP 分析器查看发生了什么?

还要检查您的不匹配http://www。使用 http:// 因为 flash 将它们视为不同的域

您是否也在您的机器上本地运行代码。这可能是您的本地安全设置

于 2010-01-15T15:15:20.813 回答
0

修改上面的 Web 代理示例以支持多个选项,如下所示:

$sOptions = "";

foreach($_GET as $sIndex => $sValue) {
  if ($sIndex == 'url') {
    $url = $sValue;
  } 
  else {
    if (strlen($sIndex) > 0) {
      $sOptions .= "&" . $sIndex;
    }
    if (strlen($sValue) > 0) {
      $sOptions .= "=" . $sValue;
    }
  }
}

$url .= $sOptions;

$session = curl_init($url); // Open the Curl session
于 2010-11-24T19:47:00.203 回答