Facebook的身份验证与高流量的网站:空的访问令牌,空/我 [英] Facebook Auth with high traffic sites: empty access tokens, empty /me

查看:149
本文介绍了Facebook的身份验证与高流量的网站:空的访问令牌,空/我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们必须在其中获得的流量的一个很好的协议的那一刻Facebook标签上运行的应用程序。人们正在签约每隔几秒钟,而且大多数是成功的。但是我遇到了以下问题:



- 在所有的(空响应,没有错误)没有收到访问令牌

- 如果收到,然后调用API / ME失败(空响应,没有错误)



编辑:显然,限制API调用不是问题,因为六百分之六百来电/ sec是每个用户,这使得很多更有意义:)。



是任何人都遇到这样的问题?我得到大约20-30成功的应用注册等一分钟,约2-3失败的。注意:这些不是谁拒绝访问应用程序的用户 - 那些在别处处理...



编辑:我收到未能打开流:HTTP请求失败HTTP / 1.0 400错误的请求


  $ TOKEN_URL = \"https://graph.facebook.com/oauth/access_token?client_id=\".$oauth_clientid.\"&redirect_uri=\".urlen$c$c($redirect_url).\"&client_secret=\".$oauth_secret.\"&$c$c=\".$$c$c;
$ =的access_token的file_get_contents($ TOKEN_URL);


解决方案

更​​新:修改我的code使用卷曲后,出现了一定的改善,但它并没有解决问题。有问题的应用程序现在是过去的用电高峰,如此明显错误的数量已经下降显着。它仍然有时会发生。该错误(最常见):


  • 卷曲错误(6):无法解析主机'graph.facebook.com

  • 卷曲错误(28):SSL连接超时

...等类似错误。

从我的数据的两个星期的经验,似乎关于请求的百分之效果时,有高流量,少的时候有低 - 但是这是非常不科学的。 :)

-

因此​​,解决办法?那么有没有人真的。看来,请求某些%将失败,我(你的)应用程序需要为优雅地处理这些错误。

我唯一的问题是,有其他人曾与高流量应用这样的经历? (在这种情况下,这意味着100万-50万的浏览量每天50 000-100 000活跃用户)

We have an app running on a Facebook tab at the moment which is receiving a good deal of traffic. People are signing up every few seconds, and most are successful. However I am running into the following problems:

- access token not received at all (empty response, no error)
- or if it is received, then API call to /me fails (empty response, no error)

EDIT: Apparently limiting of API calls is not the issue, since the 600/600 calls/sec is per user which makes a lot more sense :).

Is anyone else experiencing such issues? I am getting about 20-30 successful app signups a minute and about 2-3 failing ones. Note: these are not users who deny access to the app - those are handled elsewhere...

EDIT: I am getting "failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request"

$token_url = "https://graph.facebook.com/oauth/access_token?client_id=".$oauth_clientid."&redirect_uri=".urlencode($redirect_url)."&client_secret=".$oauth_secret."&code=".$code;
$access_token = file_get_contents($token_url);

解决方案

Update: After modifying my code to use curl, there was some improvement, but it did not resolve the issue. The application in question is now past its peak usage, so obviously the number of errors have gone down drastically. It still happens sometimes. The errors are (most often):

  • Curl error (6): Couldn't resolve host 'graph.facebook.com'
  • Curl error (28): SSL connection timeout

...and other similar errors.

From my experience with a week or two of data, it seems to effect about a percent of requests when there is high traffic, less when there is low - but this is quite unscientific. :)

--

So the solution? Well there is none really. It seems that some percent of requests will fail and my (your) application needs to handle these errors as elegantly as possible.

My only question is, has anyone else had such experience with high traffic apps? (meaning in this case 100 000-500 000 daily pageviews and 50 000-100 000 active users)

这篇关于Facebook的身份验证与高流量的网站:空的访问令牌,空/我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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