我继承了一个应用程序,我正在尝试理解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文档似乎表明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身份提供者集成
发布于 2019-02-05 22:05:40
这个库不再需要维护了。上一次重大变化是在2年前(2017年1月13日提交)
我真的建议你把这个替换成AppAuth-iOS
发布于 2019-02-06 08:53:02
看起来Facebook说你必须使用Facebook提供的SDK登录,所以为了遵守,你必须迁移到https://developers.facebook.com/docs/facebook-login/ios。
https://stackoverflow.com/questions/54396217
复制相似问题