适用于iOS的AeroGear Facebook配置 [英] AeroGear for iOS Facebook configuration

查看:73
本文介绍了适用于iOS的AeroGear Facebook配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了一个应用程序,我试图了解Facebook所需的内容与当前实施的内容之间的确切配置差异.

I inherited an app, and I am trying to understand the exact configuration differences between what Facebook wants and what is currently implemented.

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也告诉我这一点:

In addition, Facebook also told me this:

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的配置所致.

My guess is that this is due to the configuration of OAuth2 in the authentication service.

它是这样设置的:

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需要不同的配置:

Whereas the aerogear oauth docs seem to suggest a different configuration is required for 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应用程序出现问题的原因.

It also seems like the original developer is piping the input through to a Safari Webview, vs using the methods expected by the library. I'm not entirely why that is either. I think this may, in fact, be the cause of the issue Facebook has with the app.

有人可以阐明这个错误吗?我正在尝试最有效地处理它,因为有一个非常短的时间限制(一周),而且我不确定在这里是否走了正确的路.

Can anyone shed some light on this error? I'm trying to most efficiently deal with it as there is a very quick time limit (a week), and I'm not even sure if I am going down the right path here.

任何建议都将受到高度赞赏.

Any advice is highly appreciated.

我现在正在使用此版本:

I am now using this version:

https://github.com/maciej-gad-benefex/aerogear -ios-oauth2

这还需要与Keycloak身份提供者集成

This also needs to integrate with Keycloak identity provider

推荐答案

该库将不再维护.最后一次重大更改是2年前(2017年1月13日提交)

This library is not going to be maintained anymore. The last significant change was 2 years ago (Commits on Jan 13, 2017)

我真的建议您将其替换为 AppAuth-iOS

I really recommend you to replace this for AppAuth-iOS

这篇关于适用于iOS的AeroGear Facebook配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆