【发布时间】:2019-06-21 02:45:15
【问题描述】:
我继承了一个应用程序,并试图了解 Facebook 想要的和当前实现的之间的确切配置差异。
In working to create a great Platform experience for everyone, we ask developers to ensure the apps they build comply with our Platform Policies. Your app APPNAME (AppId: APPID) doesn't comply with the following:
Platform Policy 8.2: Native iOS and Android apps that implement Facebook Login must use our official SDKs for Login.
Please make sure your iOS app is using the most recent version of our SDK for Login. You can find more information on our iOS SDK for Login and other Login-related products here: https://developers.facebook.com/docs/facebook-login/ios.
编辑:此外,Facebook 还告诉我:
Thank you for reaching out and for all actions taken so far. I am still able to view the FB login using unofficial SDK [refer to screencast].
我的猜测是,这是由于身份验证服务中的 OAuth2 配置造成的。
设置如下:
private init() {
let keycloakHost = ServerConfigurator.sharedInstance.keycloakUrl
config = KeycloakConfig(
clientId: "app-name-mobile",
host: keycloakHost,
realm: "master",
isOpenIDConnect: true)
config.webView = .safariViewController
config.webViewHandler = self.webViewHandler
oauthModule = KeycloakOAuth2Module(config: config, session: KeycloakClient.session)
}
而 aerogear oauth 文档似乎建议 Facebook 需要不同的配置:
https://github.com/aerogear/aerogear-ios-oauth2
let facebookConfig = FacebookConfig(
clientId: "YYY",
clientSecret: "XXX",
scopes:["photo_upload, publish_actions"]
)
let oauth2Module = AccountManager.addFacebookAccount(config: facebookConfig)
let http = Http()
http.authzModule = oauth2Module
http.request(method: .get, path: "/get", completionHandler: {(response, error) in
// handle response
})
似乎原始开发人员正在将输入通过管道传输到 Safari Webview,而不是使用库所期望的方法。我也不完全是为什么。事实上,我认为这可能是 Facebook 与该应用程序存在问题的原因。
谁能解释一下这个错误?我正在尝试最有效地处理它,因为有一个非常快的时间限制(一周),我什至不确定我是否走在正确的道路上。
非常感谢任何建议。
编辑:我现在正在使用这个版本:
https://github.com/maciej-gad-benefex/aerogear-ios-oauth2
编辑:这也需要与 Keycloak 身份提供者集成
【问题讨论】:
标签: ios swift facebook oauth-2.0 aerogear