Posts

Showing posts with the label google sign in

Server Side Google API Access from Android

Image
Back in the dark ages I wrote a blog post on using Google Sign In to authorize a server from an Android client, and provided an accompanying gist with an example Activity in it. Recently, someone point out to me that gist was quite out of date, so I updated it to use the latest and greatest Google Sign In APIs on Android, with very pleasant results. The new version is much easier to understand, and only 2/3 the length of the previous one, without losing any functionality. That’s possible because of some of the features the Identity and Google Play Services teams at Google have added to Google Sign In, and to Google Play Services itself. Auto manageGoogle Play Services is, as the name implies, a separate service on an Android device, and requires a Binder connection. Back when I wrote my first gist this was wrapped in an API specific client (PlusClient), and more recently in a generic Google Play Services client (GoogleApiClient). Managing this connection took quite a lot of code. All …

Upgrading Firebase.com & Using Google Sign In on Android

Image
Very quick post on a problem I've seen a few people hit where they are upgrading a Firebase.com project which uses Google Sign In on Android.
Just Tell Me What To Do Already 1. Upgrade your Firebase.com project

2. Connect your Android app, but do not enter a SHA1

3. Go to the old Google Developers/Google Cloud project you were using and copy each client ID used for an Android app (e.g. the debug and release versions at least). 

4. In the Auth > Sign In Method > Google panel, enter the client IDs you copied before. 

This ensures your existing app keeps working, and sets you up for transitioning to the new SDK.  Why Am I Doing This? There are a couple of things to know:  The specific combination of Android package name and SHA1 is unique across Google. It can only exist in a single Google project, and is associated with a single client ID. An upgraded Firebase project is a Google project underneath.  This means if you go through the upgrade flow, attempt to connect your Android…