Flex 的 Google Oauth crossdomain.xml 问题
我正在尝试从 https://www.google.com/accounts/OAuthGetRequestToken。它在 Flash Builder 中工作正常,但在本地主机中则不行。我认为这是 crossdomain.xml 问题,所以我尝试在 https:// 中找到跨域文件www.google.com/accounts/crossdomain.xml 和 https://www.google.com /crossdomain.xml。但是,我找不到它。
我的问题是在哪里可以找到 OAuthGetRequestToken 的 crossdomain.xml。
请指教。谢谢。
更新:
var loader:URLLoader = new URLLoader();
var request:OAuthRequest = new OAuthRequest("GET", requestTokenUrl, oauthParams, consumer, null);
var urlrequest:URLRequest = new URLRequest(request.buildRequest(signatureMethod));
loader.addEventListener(Event.COMPLETE, requestTokenHandler);
loader.load( urlrequest );
I am trying to get the RequestToken with flex from https://www.google.com/accounts/OAuthGetRequestToken. It works fine in the Flash Builder, but not in the localhost. I think it is the crossdomain.xml problem, so I try to find the crossdomain file in https://www.google.com/accounts/crossdomain.xml and https://www.google.com/crossdomain.xml. However, I cannot find it.
My question is where I can find crossdomain.xml for OAuthGetRequestToken.
Please advice. Thanks.
Update:
var loader:URLLoader = new URLLoader();
var request:OAuthRequest = new OAuthRequest("GET", requestTokenUrl, oauthParams, consumer, null);
var urlrequest:URLRequest = new URLRequest(request.buildRequest(signatureMethod));
loader.addEventListener(Event.COMPLETE, requestTokenHandler);
loader.load( urlrequest );
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
问题可能是您需要专门允许计算机上包含 swf 的文件夹访问外部 Internet。转到 Flash 设置管理器以获取全局安全设置:
http ://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html#117502
并将硬盘上包含 swf 的文件夹添加到“始终信任这些文件中的文件”列表中地点。”为了方便起见,您可以添加整个硬盘,但您可能会面临一些安全风险。
the problem is probably that you need to specifically allow the folder on your computer that contains your swf access to the outside internet. Go the the flash settings manager for global security settings here:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html#117502
and add the folder on your HD with the swf in it to the list of "Always trust files in these locations." For convenience you can add your whole HD but you might be opening yourself up to some security risks.
谷歌是否说他们有该服务的跨域?我的猜测是他们没有。如果是这种情况,您将永远无法直接从 SWF 访问该服务。由于闪存是在客户端计算机上执行的,因此需要跨域策略来防止未经授权的网络代码在防火墙后面执行。
标准做法是使用适当的跨域策略设置您自己的服务器,并使用它来代理对任何外部服务的调用。无论如何,仅从可扩展性的角度来看,这都是一个好主意。
Does google say they have a crossdomain for that service? My guess is they do not. If that's the case, you will never be able to access the service directly from the SWF. Since flash is executed on the client machine, the crossdomain policy is needed to prevent unauthorized network code from executing behind a firewall.
The standard practice is to set up your own server with the appropriate crossdomain policy, and use it to proxy calls to any external services. This is a good idea regardless, simply from a scalability standpoint.
最后,我使用 AuthSub 进行 Flex 授权。我在以下问题请求中提到了这一点:
http://code.google.com/p/gdata -issues/issues/detail?id=1855#makechanges
如果有人有兴趣看到这种情况发生,请为上述功能请求加注星标。
Finally, I use the AuthSub for the Authorization with Flex. I have mention this in the following issue request:
http://code.google.com/p/gdata-issues/issues/detail?id=1855#makechanges
If anyone is interested in seeing this happen, please star the above feature request.