5
votes

I've set up a Python app engine project with Cloud endpoints. I'm having a problem where when I test locally, the auth with the endpoints fails but it seems to work fine when I deploy to app engine.

Here is what I've done

  • Generated an Android client id using the debug keystore
  • Generated a web client id
  • Decorated my endpoints api with allowed_clients_id = [API_EXPLORER_ID, ANDROID_CLIENT_ID, WEB_CLIENT_ID] and audiences = [WEB_CLIENT_ID]
  • In my Android app, I create a GoogleAccountCredential with the audience being "server:client_id:" + WEB_CLIENT_ID

I've deployed it and the auth works fine. When I deploy it locally, the auth works fine from the API explorer with OAuth enabled. But when I do a call from my Android app, I get this in the log:

ERROR    2014-01-22 23:29:07,006 users_id_token.py:367] Token info endpoint returned status 400: Invalid Value

I'm not sure what I'm missing.

1
did you figure it out? I have the same problem, except happening in a web app instead of an android app. - extraeee
Unfortunately I'm still stuck with it. I've just been deploying to test, it's quite a pain - dyancat
turns out for me, I set the id_token to access_token in my web client following some example. It works once I removed that. - extraeee

1 Answers

4
votes

I've just fixed what looks like the same problem, caused by not having pycrypto installed locally.

Try installing, e.g. with pip:

pip install pycrypto

The users_id_token.py module in the App Engine SDK seems to drop out of validating the id_token if pycrypto isn't installed. It then tries to validate the id_token as an auth_token which fails resulting in the error that you see.