Facebook的OAuth的错误核查验证code时有发生 [英] Facebook OAuth Error validating verification code sometimes happen
问题描述
我有一个验证Facebook用户一个很奇怪的问题。基本上,它为用户的90%,但10%我alwayas得到一个错误错误核查验证code。他们试图从不同的浏览器,操作系统登录,他们总是得到同样的错误。
我做了所有的书:
<$p$p><$c$c>https://www.facebook.com/dialog/oauth?scope=email%2C+user_birthday%2C+publish_stream%2C+publish_actions%2C+user_hometown&redirect_uri=http%3A%2F%2Fapps.facebook.com%2Fbetchallenge%2F&client_id=.....然后我抓住从响应code参数,并发送新的reqest:
<$p$p><$c$c>https://graph.facebook.com/oauth/access_token?client_secret=...&redirect_uri=http%3A%2F%2Fapps.facebook.com%2Fbetchallenge%2F&$c$c=...&client_id=212564568790055我跟所有的规则,redirect_uris中都是一样的,他们没有任何特殊字符,如?....
任何想法?
我解决了这个问题。问题是谁用自己的Facebook帐户设置为通过HTTPS连接到Facebook用户。在这种情况下,你必须发送HTTPS请求给Facebook,而不是http(虽然在我的例子是HTTPS,实际上可以我没有使用https)
I have a very strange problem with authenticating facebook users. Basically it works for 90% of users, but for 10% I alwayas get an error " Error validating verification code". They tried to login from different browsers, OS and they always get the same error.
I did all by the book:
https://www.facebook.com/dialog/oauth?scope=email%2C+user_birthday%2C+publish_stream%2C+publish_actions%2C+user_hometown&redirect_uri=http%3A%2F%2Fapps.facebook.com%2Fbetchallenge%2F&client_id=.....
Then I grab a code parameter from the response and send new reqest:
https://graph.facebook.com/oauth/access_token?client_secret=...&redirect_uri=http%3A%2F%2Fapps.facebook.com%2Fbetchallenge%2F&code=...&client_id=212564568790055
I followed all the rules, redirect_uris are the same, they don't have any special characters like ?....
Any ideas?
I solved the problem. The problem was with users who set in their facebook account to connect to facebook via HTTPS. In that case you have to send https requests to facebook , not http (although in my example it is https, acutally I wasn't using https)
这篇关于Facebook的OAuth的错误核查验证code时有发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!