1

Problem

When in an in-app-browser, like Google Hangout, Telegram or LINE messenger, the user won't be redirected back to my website after a success login through facebook login dialog. It just shows a blank page.

Everything works fine when using iPhone Safari app or Android Chrome app.

Environment

I am using Django==1.11.3 and django-allauth==0.34.0 (which utilizes Facebook Graph API v2.5), and here are my settings.py

SOCIALACCOUNT_PROVIDERS = {
    'facebook': {
        'SCOPE': ['email', 'public_profile', 'user_friends'],
        'METHOD': 'js_sdk',
        'LOCALE_FUNC': lambda request: 'zh_TW',
        'VERIFIED_EMAIL': True
    }
}

Anyone experienced the same issue?

David Buck
  • 3,752
  • 35
  • 31
  • 35
Jme Hsieh
  • 93
  • 5
  • Cross check your integration mentioned here [Django-allauth Facebook Login](https://stackoverflow.com/questions/46001809/debugging-allauth-social-account-not-logging-user-in-despite-connecting-success/46049491#46049491) – Satendra Nov 11 '17 at 08:08
  • Tried your settings but still no luck. The issue I am facing only occurs in the browser within a native mobile app (i.e. in-app-browser). – Jme Hsieh Nov 11 '17 at 14:20
  • Is there any error logs? in logcat – Satendra Nov 12 '17 at 15:14
  • check this answer if your logs are similar to this [question](https://stackoverflow.com/questions/47008921/android-webview-kitkat-and-below-error-in-java-script-function-includes/47009171#47009171) – Satendra Nov 12 '17 at 15:18

1 Answers1

0

As of 2013, Facebook: Native iOS and Android apps must not use their own web views for Facebook Login.

Technically, the root cause of the problem is that FB opens a new page to get correct login credentials, then close the new page and post the credential back to the parent page. However, there is no parent page in webview (only a single page), so it stays there as a blank page. see Making facebook login work with an Android Webview

Andy
  • 1,231
  • 1
  • 15
  • 27