AppEngine - Remote API returning 401 and too-many-auth

Just encountered this issue and nothing here resolved it. The only thing that worked for me is adding the --secure option to the remote shell command

$APPENGINE/remote_api_shell.py  --secure -s my-app.appspot.com

Ok, so what seemed to be necessary was:

  1. Go to the appspot.com admin page.
  2. Under Application Settings, enable Cloud Integration
  3. Create a new service account in the new cloud console page API Manager (existing service accounts do not seem to work)
  4. Switch to remote_api_stub.ConfigureRemoteApiFromServer — on further inspection, it appears that ConfigureRemoteApiForOAuth works fine.

At least after performing the above access works as expected.

I hope others similarly situated find this helpful.


For people using the remote api from the command line (bulkloader.py, remote_api_shell.py etc.), a 401 error might also happen if your appengine cookies are expired.

Try deleting them and authenticating again:

rm ~/.appcfg* gcloud auth login

This could happen in cases where changes made to a Google account force logging out (e.g: enabling 2 factor authentication).