firebase.auth().signInWithPopup

5,164 views
Skip to first unread message

Nemes David

unread,
May 30, 2016, 11:01:11 AM5/30/16
to Firebase Google Group
Hello all,

There is a error using the firebase.auth().signInWithPopup on mobile devices. The popup appears for a quick second and then disappears. I think this is because the OAuth redirect domains settings since a mobile devices doesn't have a domain. Is there a way to auth a mobile device ? 

Best regards,
david

boj...@google.com

unread,
May 30, 2016, 5:46:21 PM5/30/16
to Firebase Google Group
Are you calling this method from within a webview serving static files? If so, that won't work as the domain will not match the whitelisted ones. Instead use IDP mobile SDKs to obtain OAuth credentials and then call auth.signInWithCredential.

Ben Mueller

unread,
Jun 1, 2016, 12:41:27 PM6/1/16
to Firebase Google Group
FWIW, we wound up switching to signInWithRedirect (or whatever it's called) because of issues on mobile devices. Not only is tab switching super-confusing on a small-screen device, but there were certain iOS browsers (maybe Chrome and Firefox?) where auth with popup didn't work at all. So if you're able to, I'd experiment with auth with redirect.

Bassam Ojeil

unread,
Jun 1, 2016, 12:52:16 PM6/1/16
to fireba...@googlegroups.com
Hey Ben, we had tested signInWithPopup on iOS browsers and did not uncover issues. In some cases though where 3rd party cookies or data are restricted, such functionalities may fail. If it is possible, can you send us the exact information (iOS and browser versions) to help us duplicate and fix? That would be very helpful. 
Thanks.

--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/NVADjeUCxiA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/53e3f5a6-affb-4b35-bb5f-2bc2d01e37e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

boj...@google.com

unread,
Jun 1, 2016, 12:59:15 PM6/1/16
to Firebase Google Group
Assuming you are using a traditional web environment, to facilitate debugging, make sure you first test on a desktop browser as sometimes certain fixable errors can be easier to detect and those could cause the popup to open and then close automatically. For example you could be missing the authDomain in your configuration, the provider you are using was not enabled in the Firebase Console, your web page domain was not whitelisted, etc.


On Monday, May 30, 2016 at 8:01:11 AM UTC-7, Nemes David wrote:

Ben Mueller

unread,
Jun 1, 2016, 1:10:43 PM6/1/16
to Firebase Google Group
Hi Bassam,

So this was back in November 2015, authenticating via Google. What I discovered was that Chrome for iOS did not allow authWithPopup. I think that method conflicted with some security rule or other. Perhaps Firefox for iOS was the same, but I don't specifically recall. What I don't recall was what the behavior was: I don't recall whether it was that no popup appeared at all, or whether things got screwy after the user authenticated. In any event, it was bad enough that we had to bail on launching for Chrome for iOS until we managed to switch over to redirect.  My notes and Github just say that we had to switch over to authWithRedirect, but I don't have a summary of what the exact behavior was. If it's relevant, the app in question is intended for wide circulation, so there were no proxies or weird corporate networks involved, nor were there any specific configuration things for Chrome for iOS--I downloaded it to test, found the error, and then moved to switch to authWithRedirect. Sorry if this isn't helpful.

Redirect has the benefit of only having one open window, which obviously is likely to be less confusing for users. However, there is that 250ms delay after the user is redirected back to the site where the pre-auth state is visible to the end user. So that's imperfect, but still feels better than authWithPopup.
Reply all
Reply to author
Forward
0 new messages