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

2

9

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?

Noontime answered 11/9, 2017 at 21:6 Comment(1)
I just realized that installing another browser (chrome for instance), the login with google get back to work... Maybe a possible work around could be make a list of blocked user-agents and display a message to the users asking to change browser... anyway, it seems dirty =\Sturmabteilung
M
4

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');
}
Mead answered 4/2, 2022 at 13:51 Comment(0)
S
0

I had to replace signInWithRedirect with signInWithPopup and then I was able to login on mobile browser

Selia answered 2/6 at 15:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.