angularfirebasefirebase-authenticationangularfire2

Error '403 disallowed_useragent' logging to google via angularfire on a mobile browser


I am developing a project with angularfire2 v4.0.0-rc.2 in angular4 and publishing it on firebase.

The logins with facebook and google are both working on the desktop browser and on a native android app.

When I try to login within chrome via mobile browser, I got the following error: enter image description here

I've found many post about google blocking the access by webViews but none give a really answer about how to fix the problem without workarounds not specific to firebase.

The error occurs either using angularfire signIn with popup and redirect.

Any thoughts?


Solution

  • I am having a similar issue with Google Login (and Facebook Login actually).

    Specifically, when someone shares a link within the Facebook Messenger Application (iOS AND Android) and the link is clicked using the in-app browser, I get the same 403 error.

    The best workaround I have found for this is to detect the user agent (navigator.userAgent) and see whether it includes 'Messenger' in the string and then show a message to ask them to open in their normal browser.

    It would be much better if there was a way for these in-app browsers that have this problem to either just work, or to have a way to open in a normal browser without the user needing to find that functionality.

    if (window.navigator.userAgent.includes('Messenger')) {
      console.log('User agent includes Messenger');
    } else {
      console.log('User agent does not include Messenger');
    }