I am using the Google Identity Toolkit on app engine.
Everything works fine when testing on localhost
But when I deploy on app engine, the gtoken cookie is not sent to the server. It is not present in the headers request as shown in the first screenshot. (left part is localhost, gtoken is set properly, right part is on app engine, no gtoken present).
I am using the 1.1.0-beta version of the google identity toolkit. The sign-in functionality works fine both on localhost and on app-engine. What fails is when I call one of my api endpoints (gtoken not present in headers when deployed, but works locally).
The problem is happening whether I user Chrome or Firefox, no ad-block etc. The second screenshot shows that the cookie is present (localhost and app engine). It is just not sent in the headers, so I cannot validate the token on the server side.
What could be causing the gtoken cookie not to be set properly when I deploy on app engine?
To me, that sounds like a CORS issue, I am not sure how to tweak the gapi client headers to make sure it sends the gtoken cookie properly... (https://cloud.google.com/appengine/docs/java/endpoints/consume_js)