Android AccountManager and GAE app with OpenID Federated Login

147 views
Skip to first unread message

Rishi Arora

unread,
Jan 6, 2012, 10:17:59 AM1/6/12
to google-a...@googlegroups.com
Does anyone have any experience with authenticating an Android App with a GAE app configured for OpenID/Federated Login?  I currently do this with my GAE app configured with Google Accounts API (mostly based on Nick Johnson's blog here: http://blog.notdot.net/2010/05/Authenticating-against-App-Engine-from-an-Android-app), but would like to switch to Oauth.  Right now, my Android app uses AccountManager.getAuthtoken(auth_token_type="ah") to get an auth token which can be used to generate a cookie.  All future web requests that include that cookie can then be authenticated by my App Engine App.  I'm guessing if I have to switch my App Engine App to use Oauth instead, I'd have to change the AccountManager.getAuthToken() call in my Android app?  The AccountManager on Android supports OAuth 2.0 protocol, so there's got to be some way of doing this.

I was able to use Ikai's notes here: http://ikaisays.com/2011/05/26/setting-up-an-oauth-provider-on-google-app-engine/, to be able to authenticate a Python client with an App Engine app using OAuth, but I'd like to do the same with an Android App.  Seems easy enough, to replicate Ikai's python client code in Java on Android, but what I'd like to do is to not to have the user type in their Google account credentials.  Right now, if I implement my Android app based on Ikai's python client, I'd have to redirect the user to a WebView with a URL that asks them to type their Google account credentials.  I'm wondering if this step can be eliminated by using Android AccountManager, where the users google account credentials are already cached.

Any ideas anyone?

Many thanks in advance.
-Rishi

Reply all
Reply to author
Forward
0 new messages