iphone - Facebook SDK 2.0 的 Facebook OAuth 登录问题

标签 iphone facebook authentication oauth sdk

我正在开发一个处理 Facebook 的 iPhone 应用程序。我使用最新的 SDK facebook-facebook-ios-sdk-cf1c2c3 (SDK 2.0) 来允许用户使用 OAuth 登录 Facebook 帐户。

用户可以在设备 iPod Touch(4.3.1) 上毫无问题地登录。但在 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>}

我从 FBLoginDailog 中提取了 URL 并尝试在 iPhone -> Safari 中加载它。它重定向到以下 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

此外,我从链接中找到了以下解决方法: https://github.com/facebook/facebook-ios-sdk/issues/139

但是,该链接还提到不要将其用于 App Store 可执行文件。但是,我也遇到了应用程序商店可执行文件的问题。

如何解决这个问题?

最佳答案

这不是 SDK 问题。设备(3GS)中设置的日期和时间不正确。

关于iphone - Facebook SDK 2.0 的 Facebook OAuth 登录问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6306574/

相关文章:

ios - 无法在 iPad 中使用应用程序内的 facebook 按钮注销

javascript - FB :comments getting height getting "unhealthily" cut

authentication - 站点如何安全地支持 http(非 SSL) session ?

iphone - UICollectionView 动画(插入/删除项目)

ios - 如果 Watch 应用程序在 iPhone 应用程序运行之前打开,则不会填充任何数据

iphone - UISplitViewController 中的 UITableViewController

android - 阻止 LoginActivity 弹出 onResume()

iphone - 忽略 iphone 上的 Https SSL 异常

java - Facebook API for Java 应用程序(例如,使用 Swing 库)

php - CakePHP Auth 允许 JSON 扩展