1

I have been using Google Cloud Endpoints as backend for my Android app since it was only open for invitation. But now my app suddenly can't be authorized (401 error, invalide token) - so nobody of my users can sync anymore.

The code on the server ((Google App Engine) and in my Android app have not changed. So I am not sure what is going on...

The only thing I have changed is the settings in the new Developers Console https://console.developers.google.com (not the old console https://code.google.com/apis/console/). But I tested it right after and it was still working. Only some time after that agin the errors started.

This is what I changed under the settings:

1) APIs & auth -> Credentials APIs & auth

  • I added a URL to JavaScript Origins under client ID for web application (same as my Android app use), because I am working on a website that will use the API with JavaScript.

I have now removed the URL (so it is back to how it was) but I still get 401 error. Client ID and Client secret are also like before.

2) APIs & auth -> Consent screen

  • added icon and new URL to website.

Are there some compatible problems with old code and the new console? Or are the some problem with Google Cloud Endpoints now?

This is the error message I get when my Android app try to access the Google cloud endpoint.

05-13 22:17:33.726: W/GLSUser(209): GoogleAccountDataService.getToken()
05-13 22:17:37.664: W/GLSUser(209): GoogleAccountDataService.getToken()
05-13 22:17:41.667: W/GLSUser(209): [apk][apk] Permission for com.myapp to access audience:server:client_id:324234243423-sdfsdffdsagsdagsdgsadfsadf.apps.googleusercontent.com will be managed remotely.
05-13 22:17:44.011: W/System.err(8058): com.google.a.a.b.b.c: 401 Unauthorized
05-13 22:17:44.011: W/System.err(8058): {
05-13 22:17:44.011: W/System.err(8058):   "code": 401,
05-13 22:17:44.011: W/System.err(8058):   "errors": [
05-13 22:17:44.011: W/System.err(8058):     {
05-13 22:17:44.011: W/System.err(8058):       "domain": "global",
05-13 22:17:44.011: W/System.err(8058):       "location": "Authorization",
05-13 22:17:44.011: W/System.err(8058):       "locationType": "header",
05-13 22:17:44.011: W/System.err(8058):       "message": "Invalid token.",
05-13 22:17:44.011: W/System.err(8058):       "reason": "required"
05-13 22:17:44.011: W/System.err(8058):     }
05-13 22:17:44.011: W/System.err(8058):   ],
05-13 22:17:44.011: W/System.err(8058):   "message": "Invalid token."
05-13 22:17:44.011: W/System.err(8058): }

Thanks :)

4

1 回答 1

0

好的,它现在又开始工作了。Google 已经修复了导致该问题的 Google App Engine 中的错误。有关更多详细信息,请参阅此帖子:

Google App Engine 突然开始失败的端点身份验证

于 2014-05-15T12:21:53.030 回答