Search code examples
androidgoogle-app-engineoauthopenid

Authenticating against App Engine from Android app with Federated Login (OpenID)


I've followed Nick Johnson's tutorial on Authenticating against App Engine from Android

Is there anyway to get the same workflow (no web signin) with Federated Login (even if support is limited to Google Accounts)?

[Edit] Additional Info

The current setup includes:

  • App Engine's UserService configured for federated login (openId..gmail, aol, myspace?,...)
  • Facebook (OAuth)
  • Twitter (OAuth)

All the authentication types are wrapped in a UserService, so I can call UserService.getCurrentUser() (Similar to Appengine's UserService, but supports twitter, and facebook).

Accounts can have multiple authentication methods linked together.

So far the clients are all web based, and things are working nicely. :D

I'd like to:

  1. Add a public Api (for web and native mobile apps),
  2. use the Api internally for native mobile apps.

What are the options?

I was thinking of limiting authentication to Google Accounts for the Android App, in hopes of avoiding the web based sign in screen. Even so it would be nice to support facebook and twitter for the web Api.


Solution

  • No, OpenID is a browser-based auth standard - it relies on user being directed to external auth page and then back to app page.

    You can do this via WebView inside a Dialog for a smooth user experience. See the LeanEngine open-source project for an example implementation: server and client. Server is a bit complicated as it supports both Facebook and OpenID login. OpenID only login would be simpler. You basically only need the client example.

    However, if you do not need OpenID and are willing to limit your users to Google Account, then you can use Google ClientLogin API. An example usage.