FirebaseUI sign-in with Google

787 views
Skip to first unread message

OtherGuy

unread,
Dec 25, 2015, 5:21:36 PM12/25/15
to Firebase Google Group
I'm attempting to implement FirebaseUI sign-in with Google in my Android app. The problem is that it always fails [onFirebaseLoginUserError(..) called] with the error message: 

    LOGIN_CANCELLED: User closed login dialog.

Digging a little deeper, I've found that onActivityResult(..) is called with resultCode == 0 and

    GoogleSignInResult.getStatus().getStatusCode() == 12501 
    GoogleSignInResult.getStatus().getStatusMessage() == "null"


--- But ---

If I use the exact same Android app (same Firebase app, same Google app, same signing key, same package, etc..) but comment out the FirebaseUI parts and instead follow Google's own integration guide (https://developers.google.com/identity/sign-in/android/sign-in), the sign-in process works without issue. 


Any idea why? 


Background:

I've confirmed that my app can read/store data in my Firebase. 

I've followed the instructions at: 


Dependencies are: 

    compile 'com.firebase:firebase-client-android:2.5.0+'
    compile 'com.firebaseui:firebase-ui:0.3.0'
    compile 'com.google.android.gms:play-services-auth:8.3.0' 
    

Frank van Puffelen

unread,
Dec 25, 2015, 5:32:47 PM12/25/15
to Firebase Google Group
Yeah. That one took me quite some time to figure out when we got it internally.

If most likely means that you're passing an OAuth client ID for Android into google_client_id. It should be an OAuth client ID for a web application. This is not very intuitive, but Firebase needs a web application ID, since it uses a full OAuth token to interact with Google.

This is a fairly common mistake and we're looking how to make it harder to run into this problem. For example: for FirebaseUI 0.3.1, we'll likely get rid of the need for the google_client_id value altogether.

     puf

OtherGuy

unread,
Dec 25, 2015, 8:20:35 PM12/25/15
to Firebase Google Group
That fixed it. Thanks! 

Happy Holidays

Philip

unread,
Jun 5, 2016, 6:04:22 PM6/5/16
to Firebase Google Group
Hi,

I've run into the same problem, with firebaseUI version 0.4.0.

It took me quite some while to get here, because first I had to understand this problem with the UI:

(on a seperate note, the "fix" that the ActivityHelper.dismissDialog() is called in the  onFailure method of AuthMethodPickerActivity has somehow not made it into the library as it is imported by gradle, although I can find it in the GitHub files. I have no idea how and where gradle gets this libraries as I'm very new to this, but there seems to be a problem somewhere)

I think I have a basic idea of what you are saying with the client IDs beeing "wrong", yet I don't know how to fix this. Some changes in the Firebase project, adaptations in the google-services.json, wait for a bugfix in firebaseUI?

Any help will be appreciated.


dependencies {
compile 'com.google.firebase:firebase-core:9.0.2'
compile 'com.google.firebase:firebase-database:9.0.2'
compile 'com.google.firebase:firebase-auth:9.0.2'
compile 'com.firebaseui:firebase-ui-database:0.4.0'
compile 'com.firebaseui:firebase-ui-auth:0.4.0'
compile 'com.google.android.gms:play-services-auth:9.0.2'
compile 'com.google.android.gms:play-services-auth-base:9.0.2'
}

Samuel Stern

unread,
Jun 6, 2016, 12:48:12 PM6/6/16
to fireba...@googlegroups.com
Hi Phillip,

The issue you mentioned (#121) was fixed in the master branch but the new version containing the fix (0.4.1) has not been released to jCenter yet.  So you are correct in thinking that the bug still exists in 0.4.0.  You have a few options here:
  1. Wait for 0.4.1 to be released.
  2. Follow the instructions to install FirebaseUI to your local maven repo from the master branch.  Then reference `mavenLocal()` in your gradle repositories.
- Sam

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, 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/46cdc617-03a3-4dea-aa1c-22a5bfc82cb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Philip

unread,
Jun 6, 2016, 1:32:54 PM6/6/16
to Firebase Google Group
Hi Sam, 

thank you for your answer, any hints when 0.4.1 will be released? I'll work with an local branch as you suggested until then!

Samuel Stern

unread,
Jun 6, 2016, 1:46:31 PM6/6/16
to Firebase Google Group
Hi Phillip,

No hard timeline, but expect days or weeks, not months or longer.  Thanks for the patience!

- Sam

Reply all
Reply to author
Forward
0 new messages