Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Endpoints Android Client - Auth error

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.

like image 891
dyancat Avatar asked Oct 01 '22 19:10

dyancat


1 Answers

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.

like image 167
000ts Avatar answered Oct 13 '22 12:10

000ts