I am currently making API calls for my backend using the Google Cloud Endpoint JavaScript client. The problem is that cookies for my page are not added to HTTP requests. How to add a gitkit gtoken cookie to my request.
- Backend is Google App Engine Java
- Using Goole Cloud Endpoints to Build My API
- Using the Google Cloud Clouds Google web client downloaded as follows
gapi.client.load('myApi', 'v1', resourceLoaded, 'https://my-project-id.appspot.com/_ah/api');
I have already configured Google Cloud Endpoints on the backend to allow cookies. auth = @ApiAuth(allowCookieAuth = AnnotationBoolean.TRUE)
My endpoint is as follows.
@ApiMethod(path = "user-account") public UserAccount get(HttpServletRequest httpRequest) { GitkitUser gitkitUser = Gitkit.validate(httpRequest); // returns null Cookie[] cookies = httpRequest.getCookies(); log.severe("# of cookies: " + cookies.length); for (Cookie cookie : cookies) { log.severe("cookie name: " + cookie.getName()); log.severe("cookie value: " + cookie.getValue()); } /* * Logs 1 for
I make calls with the Google Cloud Endpoints JS client this way.
gapi.client.myApi.userAccountResource.get().execute(function (resp){ ... });
Is there something I have to do to make sure that the Endpoints JS client contains a gtoken cookie in it?
google-app-engine cookies google-identity-toolkit google-cloud-endpoints
Marc M.
source share