@barryhunter, that's pretty much the way to manage the migration from one auth service/method to another, is to correlate the identities (one being freshly accessed/created on the "new" system, the other being the existing system's identity for this user), by having them auth to both services at the same time. At that moment, your app can migrate that user to the new system and store the new credentials / identity information.
If all access to user information within your app references cached versions of the data retrieved from the identity endpoint anyways, rather than only storing it in the session, it won't be necessary to change your auth code anywhere but in the places where sign-in, sign-out, or extra auth flows take place.
In the
docs for the
Users service, which is one option on the platform for auth and identity, under the heading "Accessing Account Information", you can see that the numeric id on the retrieved User object is a unique id which is shared across all App Engine apps. This is distinct from the Google+ numeric id, which is returned from interacting with the
Google+ API.
@tempy, your original post raises some important questions. This is true:
Google is suggesting that migration basically involves using Google's open-to-all OAuth2 API, which has no special integration with GAE ... the google ID's that this API will return will not match the ones that I had previously seen with UsersAPI+OAuth1
The following, therefore, gets to the heart of your issue:
... the app is in trouble, those IDs are keyed to existing users. ... how do I go about using OAuth2 to get the same google IDs that I've been getting with the UsersAPI+OAuth1 in the past?
If you've used those old numeric IDs (or strings for that matter) as indexes (or as part of indexes) anywhere in your database, or have persisted them into the fields of any other records than a single, now-updated User record, it will create problems to leave these other indexes and records in the database, coupled to the now-deprecated ID, unchanged.
So, a migration process for each such index and record should be performed at each moment when a user performs the new auth for the first time. It should be done atomically, to ensure no trace of the old ID remains in the database. All code which runs queries against the ID (whether as an index or as a record field) should gather its ID from the User object.
This seems to be sufficient to guarantee consistency in the migration from one system of auth to another, and the parallel migration from one system of numeric IDs to another.