Skip to content

Facebook login fails logging in to Facebook from an embedded browser #1164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
EAncis opened this issue Apr 19, 2022 · 9 comments · Fixed by #1172
Closed
4 tasks done

Facebook login fails logging in to Facebook from an embedded browser #1164

EAncis opened this issue Apr 19, 2022 · 9 comments · Fixed by #1172
Labels
type:question Support or code-level question

Comments

@EAncis
Copy link

EAncis commented Apr 19, 2022

New Issue Checklist

Issue Description

I am part of the [removed] developer team, one of our apps is [removed]. Our Apps (iOS/Androd) include the authentication throughout the Facebook account that has always workred on each platform.

Now we have been contacted by the Facebook team beacuse a persiting issue on this feature douring these last mounths on Android.

We have updates the Facebook SDK and your Parse-SDK-Android, che cked our existing implemetantion about the login flow from the developer Facebook documentation and the your Parse Facebook Utils for Android.

Everything appears correct, but the issue persists.

Maybe Parse Facebook Utils for Android need to be update after any Facebook SDK Change?
Anyway can you help us to fix our issue?

Steps to reproduce

  • Install Android Facebook app on your device;
  • Login on facebbok;
  • Download the [app removed]
  • Follow the introdicing tutorial or skip it;
  • Tap on the Facebook login button.

Actual Outcome

Facebook login error view with For your account security, logging in to Facebook from an embedded browser is disabled. You may be able to continue by updating the app you're logging in from and trying again message.

Expected Outcome

Proceed to login on the [removed] app and access the its homeview

Environment

Developing on Android Studio Bumblebee 2021.1.1 Patch 3, Java Language, Gradle 7.2 and Gradle plugin 7.1.3
Tested on Android 10 (physical device) and 12 (emulated device)
Dependencies:
com.facebook.android:facebook-android-sdk:13.1.0:
com.facebook.android:facebook-login:13.1.0
com.github.parse-community.Parse-SDK-Android:parse:3.0.0
com.github.parse-community.Parse-SDK-Android:google:3.0.0
com.github.parse-community.Parse-SDK-Android:facebook:3.0.0
com.github.parse-community.Parse-SDK-Android:fcm:3.0.0
com.github.parse-community.Parse-SDK-Android:ktx:3.0.0
com.github.parse-community.Parse-SDK-Android:coroutines:3.0.0

Parse Android SDK

  • SDK version: 3.0.0
  • Operating system version: Android

Server

  • Parse Server version: 3.9.0
  • Operating system: Back4App does not provides that info
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): www.back4app.com

Database

  • System (MongoDB or Postgres): Managed by Back4App
  • Database version: Managed by Back4App
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Managed by Back4App

Logs

Any long is retrived into theLogcat.
On debugging mode we can check that after the FB Button onclick the flow passes into

ParseFacebookUtils.logInWithReadPermissionsInBackground(...)

then throught the

 @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode, resultCode, data);
  ParseFacebookUtils.onActivityResult(requestCode, resultCode, data);
} 

but does not return from the callback into any case of

@Override
  public void done(ParseUser user, ParseException err) {
    if (user == null) {
      Log.d("MyApp", "Uh oh. The user cancelled the Facebook login.");
      ...
    } else if (user.isNew()) {
      Log.d("MyApp", "User signed up and logged in through Facebook!");
      ...
    } else {
      Log.d("MyApp", "User logged in through Facebook!");
      ...
    }
  }
@parse-github-assistant
Copy link

parse-github-assistant bot commented Apr 19, 2022

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza
Copy link
Member

mtrezza commented Apr 20, 2022

Facebook login error view with For your account security, logging in to Facebook from an embedded browser is disabled. You may be able to continue by updating the app you're logging in from and trying again message.

See https://developers.facebook.com/blog/post/2021/06/28/deprecating-support-fb-login-authentication-android-embedded-browsers/

Maybe there is something we need to change in the Parse Android SDK? In my understanding, upgrading to the newest FB SDK should fix the issue.

@mtrezza mtrezza closed this as completed Apr 20, 2022
@mtrezza mtrezza added the type:question Support or code-level question label Apr 20, 2022
@mtrezza mtrezza reopened this Apr 20, 2022
@mtrezza mtrezza changed the title Facebook login does not work com.github.parse-community.Parse-SDK-Android:facebook:3.0.0 Facebook login fails logging in to Facebook from an embedded browser Apr 20, 2022
@azlekov
Copy link
Contributor

azlekov commented Apr 21, 2022

@mtrezza thanks for the link. Deprecating webviews page gives nice guide what to do in order to overcome the deprecation.

In my understanding, upgrading to the newest FB SDK should fix the issue.

Here we use version v12 of the SDK which will be bumped to latest v13 in #1163

@EAncis when login what happens - a web view appear to login or the Facebook app is opened? Will be strange if web view login is triggered when you have installed Facebook on the phone. Can you confirm that login is not working also without Facebook app?

@azlekov
Copy link
Contributor

azlekov commented Apr 21, 2022

From Deprecating webviews it looks that the app should have configured CustomTabs something I think is not part of the Parse Facebook module right now.

@EAncis may you please follow these steps in the Deprecating webviews and tell us the outcome:

  • Ensure that your app has configured support for Custom Tabs properly. (For more information on Custom Tabs, see the Custom Tabs documentation.) To test your configuration:
    • Ensure that you have a browser compatible with Custom Tabs (example browsers that support Custom Tabs include Chrome, Samsung Browser, etc).
    • Delete the Facebook app from your device if you have it installed. Login from your app. You should see a window open in the external browser rather than in a native WebDialog.

@EAncis
Copy link
Author

EAncis commented May 11, 2022

@mtrezza thanks for the link. Deprecating webviews page gives nice guide what to do in order to overcome the deprecation.

In my understanding, upgrading to the newest FB SDK should fix the issue.

Here we use version v12 of the SDK which will be bumped to latest v13 in #1163

@EAncis when login what happens - a web view appear to login or the Facebook app is opened? Will be strange if web view login is triggered when you have installed Facebook on the phone. Can you confirm that login is not working also without Facebook app?

Hi @mtrezza, sorry for the delay in my reply, I describe 3 use cases:

  1. With Facebook app logged: user clicks on Facebook login button, somethings happens (a quick loader and a quick view appears) but my app does not proceed.

  2. With Facebook app not logged: user clicks on Facebook login button, it's opened the Facebook app, user select his account, it's tried the login flow, the it's shown this error view inside my app
    Screenshot_20220511-150146

  3. Without facebook app: user clicks on Facebook login button, it's opened the chorme embedded broswer with the same message error
    Screenshot_20220511-151729

@EAncis
Copy link
Author

EAncis commented May 11, 2022

In addition to what just written to @mtrezza a strange behavior that I have observed is that the login is successful only with the developer facebook account credentials

@mtrezza mtrezza linked a pull request May 12, 2022 that will close this issue
5 tasks
@azlekov
Copy link
Contributor

azlekov commented May 13, 2022

@EAncis did you try with older version of the Parse SDK for Android?

It will be important to know if it's failing with an older version. This will hint whenever this is issue in the SDK or misconfiguration in your app.

@EAncis
Copy link
Author

EAncis commented May 13, 2022

with this configuration the FB login was still working at the beginning of the year, then stops

Gradle 4.1.1
Android API 31

dependences:
Parse SDK 1.23.1
facebook-login 5.15.3
Parse SDK 1.23.1
facebook-android-sdk:4.42.0

Then I tried with this update:

Gradle 7.1.3
Parse SDK 3.0.0
facebook-login 13.1.0
facebook-android-sdk 13.1.0

but the issues is not fixed

@azlekov
Copy link
Contributor

azlekov commented May 13, 2022

And you did check if there are required adjustments to configure your app to the newer Facebook SDK?

Jumping from:

facebook-login 5.15.3 -> facebook-login 13.1.0
facebook-android-sdk:4.42.0 -> facebook-android-sdk 13.1.0

Is big leap...

When I update the Facebook SDK and the Facebook module on the Parse SDK for Android I did check for some breaking changes regarding the SDK itself and the way the code is organized, implemented etc and did not find anything.

@mtrezza mtrezza linked a pull request Jun 3, 2022 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
3 participants