ClientId not updated when deploying - User injected null

流过昼夜 提交于 2019-12-07 05:58:29

问题


I am creating a project with App Engine and Cloud EndPoints using OAuth 2.0.

I created and configured all the clientIds (WEB, Android and iOS), but when both I run the server in local or I deploy to App Engine PROD, I always get the following problem:

WARNING: getCurrentUser: clientId 292824132082.apps.googleusercontent.com not allowed

This clientId 292824132082.apps.googleusercontent.com is the default one generated automatically when you create the Cloud EndPoints the first time, and it is supposed to be overwritten when you configure you own clientIds and generate the Cloud EndPoint Client Libraries. I can see in my noteendpoint-v2.api (My API is called NoteEndPoint) that the clientIds inside are update, but I cannot get they are published to local or PROD.

Any clue about what I am doing wrong or I am forgetting?


回答1:


If you are testing your endpoint in API Explorer you need to add it's ID as one of the accepted ones:

 @Api(name = "myApi",
     version = "v1",
     ...
     clientIds = {Constants.API_EXPLORER_CLIENT_ID, yourOtherIds}

Where Constants.API_EXPLORER_CLIENT_ID is

     public static final String API_EXPLORER_CLIENT_ID = com.google.api.server.spi.Constant.API_EXPLORER_CLIENT_ID;


来源:https://stackoverflow.com/questions/18523508/clientid-not-updated-when-deploying-user-injected-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!