Firebase Android with Google Sign-in

280 views
Skip to first unread message

Carlos Hwa

unread,
Nov 6, 2015, 5:08:49 PM11/6/15
to Firebase Google Group
The recently released Google Play Services 8.3 no longer requires Google Plus (and also the GET_ACCOUNTS permission) for Google Sign-In:

I can't get Google authentication with Firebase to work using the new flow though:
I based my code off of the ServerAuthCodeActivity sample in the sign-in sample project:

but when I pass the token returned by:
GoogleSignInAccount.getServerAuthCode();

into:
Firebase.authWithOAuthToken("google", token, new AuthResultHandler("google"));

I get the following Firebase error:
Invalid authentication credentials provided.

Is Firebase authentication with Google supported with the new Google Play Services without requiring Google Plus?

Jacob Wenger

unread,
Nov 6, 2015, 6:28:21 PM11/6/15
to fireba...@googlegroups.com
Hey Carlos,

That error usually means your app is not configured properly. Can you verify that you did all the steps in this guide, specifically that your client ID is correct?

Cheers,
Jacob

--
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/c6db94fe-e03d-4837-aabc-af78fa6929d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carlos Hwa

unread,
Nov 9, 2015, 11:54:36 PM11/9/15
to Firebase Google Group
Hi Jacob,
Everything on the server-side should be configured correctly, since I have had authentication with Google+ working fine in my app for a while. I am trying to authenticate using the new Google Play Services w/o Google+, which is giving me the error.

One change with the new method is I have to pass in the server's client ID to the GoogleSignInOptions object using requestServerAuthCode(CLIENT_ID). The value I am passing in here is the same client ID I have set on my Firebase instance under Google Authentication.

If authentication without Google+ should work with Firebase, can you update the example project (https://github.com/firebase/firebase-login-demo-android)?

Thanks.

Jacob Wenger

unread,
Nov 12, 2015, 1:38:05 PM11/12/15
to fireba...@googlegroups.com
Carlos, check out Puf's answer to a related Stack Overflow question. Hopefully it leads to an answer for you!

Jacob

Carlos Hwa

unread,
Nov 12, 2015, 6:18:35 PM11/12/15
to Firebase Google Group
Yes! The new oauth scope string is what I was missing. Working now, thanks! Still would be nice to see an updated login demo app though
Reply all
Reply to author
Forward
0 new messages