2

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.

EDIT: 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]. 

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

It is setup like this:

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)
     }

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
})

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.

EDIT: I am now using this version:

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

EDIT: This also needs to integrate with Keycloak identity provider

Steven Matthews
  • 9,705
  • 45
  • 126
  • 232

2 Answers2

1

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

I really recommend you to replace this for AppAuth-iOS

Daniel Passos
  • 1,307
  • 1
  • 9
  • 8
0

It looks like Facebook is saying that you have to use the Facebook-supplied SDK for login, so in order to comply, you have to move to https://developers.facebook.com/docs/facebook-login/ios.

patroclus974
  • 364
  • 1
  • 3