I’m writing an Android application that I want to be able to send requests to a Google App Engine application. In order to do this, the Android app needs to authenticate the user (should be able to just use their Google Account). I’m not sure I’m doing it right, but this is the only way I’ve found so far:
- Post email, password, etc. to https://www.google.com/accounts/ClientLogin
- Obtain an authorization token from the aforementioned address
- Use the authorization token in the header of the requests to the AppEngine application
But this isn’t working (users.get_current_user() still returns None). Is there a right way to do it?
The approach you describe is almost correct. Instead, you need to:
This is the process appcfg uses – see appengine_rpc.py for an example of how to use it (and a module you can use, if you’re using Python) – specifically, the _Authorize function.