简体   繁体   English

Facebook SDK 2.0 的 Facebook OAuth 登录问题

[英]Facebook OAuth login problem with Facebook SDK 2.0

I am developing an iPhone application that deals with Facebook.我正在开发一个处理 Facebook 的 iPhone 应用程序。 I am using the latest SDK facebook-facebook-ios-sdk-cf1c2c3 (SDK 2.0) to allow the user to login to Facebook account using OAuth.我正在使用最新的 SDK facebook-facebook-ios-sdk-cf1c2c3 (SDK 2.0) 来允许用户使用 OAuth 登录 Facebook 帐户。

User can login without any problem in device iPod Touch(4.3.1).用户可以在设备 iPod Touch(4.3.1) 中毫无问题地登录。 But in iPhone 3GS I get the following error:但在 iPhone 3GS 中,我收到以下错误:

Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be \u201cm.facebook.com\u201d which could put your confidential information at risk." UserInfo=0x1b8350 {NSErrorFailingURLStringKey=https://m.facebook.com/dialog/oauth?type=user_agent&display=touch&redirect_uri=fbconnect://success&sdk=2&scope=read_stream,publish_stream&client_id=<APP_ID>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSErrorFailingURLKey=https://m.facebook.com/dialog/oauth?type=user_agent&display=touch&redirect_uri=fbconnect://success&sdk=2&scope=read_stream,publish_stream&client_id=<APP_ID>, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be \u201cm.facebook.com\u201d which could put your confidential information at risk., NSUnderlyingError=0x1b83a0 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be \u201cm.facebook.com\u201d which could put your confidential information at risk.", NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x1be310>}

I extracted the URL from the FBLoginDailog and tried loading it in iPhone -> Safari.我从 FBLoginDailog 中提取了 URL,并尝试在 iPhone -> Safari 中加载它。 It redirects to the following URL and allows the user to login:它重定向到以下 URL 并允许用户登录:

http://m.facebook.com/login.php?app_id=<APP_ID>&sdk=2&cancel=fbconnect://success?error_reason=user_denied&error=access_denied&error_description=The+user+denied+your+request.&fbconnect=1&next=https://www.facebook.com/connect/uiserver.php?method=permissions.request&app_id=<APP_ID>&display=touch&redirect_uri=fbconnect;//success&sdk=2&type=user_agent&fbconnect=1&perms=read_stream,publish_stream&from_login=1&rcount=1

Also, I have find the following workaround from the link: https://github.com/facebook/facebook-ios-sdk/issues/139另外,我从链接中找到了以下解决方法: https : //github.com/facebook/facebook-ios-sdk/issues/139

But, the link also mentions not to use it for App Store executable.但是,该链接还提到不要将其用于 App Store 可执行文件。 But, I am getting the problem for app store executable also.但是,我也遇到了应用商店可执行文件的问题。

How do I solve this?我该如何解决这个问题?

This was not SDK problem.这不是 SDK 问题。 The date and time set in Device (3GS) was improper.设备 (3GS) 中设置的日期和时间不正确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM