Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ClientId not updated when deploying - User injected null

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?

like image 905
Sca09 Avatar asked Aug 30 '13 01:08

Sca09


Video Answer


1 Answers

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;
like image 84
lujop Avatar answered Sep 30 '22 06:09

lujop