cordova-plugin-facebook-connect / cordova-plugin-facebook-connect

Use the latest Facebook SDK in your Cordova and Ionic projects
Other
63 stars 90 forks source link

For your account security logging into facebook from an embedded browser is disabled #110

Open Mahmoud-Abdelsame3 opened 2 years ago

Mahmoud-Abdelsame3 commented 2 years ago

Hello all,

I have been a user of cordova-plugin-facebook4 for years on my hybrid apps and of this plugin since the facebook4 plugin got deprecated in 2019.

Recently i have been getting reports from users that the facebook login is failing on multiple apps of mine giving the following error "For your account security logging into facebook from an embedded browser is disabled, you may be able to continue by updating the app you're logging in from and try again"

Screenshot_20211205_055002_com supergeeks poultry365

I was able to reproduce this error by uninstalling the facebook app from the device. and by doing some research i found the following article HERE ; Which basically states that facebook deprecated FB Login authentication on Android embedded browsers beginning of October 5, 2021.I also found this community post HERE stating that its an ongoing issue that hasn't been fixed yet. The following is a video recording of the login process if you don't have the facebook app installed on your device VIDEO HERE.

Conclusion; When the facebook app is installed on a user's device the facebook SDK triggers and the login flow is completed successfully but when the facebook app is not installed on the user's device plugin tries to trigger a browser login and you can even see it for a second before facebook api gives this message you see "for your account security logging into facebook from an embedded browser is disabled". I even tried to enable Embedded Browser OAuth Login from the facebook dashboard but that didn't change the behaviour at all.

Edit : Im using the latest version of facebook-connect plugin which is 3.2.0 right now, and this version of the plugin uses facebook android sdk version 11.3.0

Edit : Reading further on the plugin contributors answers on similar questions by the community like HERE and HERE ; They are saying that the plugin will just trigger a custom tab instead of a webview which simply is not true as the video above shows.

**Edit : After couple more hours of investigating turns out this plugin needs androidx to work and during build cordova-plugin-facebook4 is installed which uses facebook android sdk version 5.13 which doesn't support custom tabs .. so after adding the following plugins everything worked just fine.

Please close this.

plugin name="cordova-plugin-androidx" plugin name="cordova-plugin-androidx-adapter"**

Im posting this for those who have been facing the same issue on their apps as i didn't see a similar issue here and hoping for a fix or a workaround from the bright minds in here.

Peace.

uareurapid commented 1 year ago

this is actually still a problem, the message still shows even if the login window is opened on a custom tab (not a dialog) because the SDK tries to append "/dialog" to the url... then you get a redirect to/with the message (even if it was not a dialog that was opened)

egorvas commented 1 year ago

this is actually still a problem, the message still shows even if the login window is opened on a custom tab (not a dialog) because the SDK tries to append "/dialog" to the url... then you get a redirect to/with the message (even if it was not a dialog that was opened)

Same shit here. We tried to use cordova-plugin-androidx and cordova-plugin-androidx-adapter but it didn't change anything. Our error message saying "For your account security, logging into Facebook from an embedded browser is disabled. To continue, download and log into the Facebook app on your device and try again". But the latest facebook app is installed.