ClientId not updated when deploying - User injecte

2019-05-02 07:08发布

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条回答
beautiful°
2楼-- · 2019-05-02 08:13

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;
查看更多
登录 后发表回答