我继承了一个应用程序,我试图了解 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 身份提供者集成