google endpoints (java), session cookies and iOS

72 views
Skip to first unread message

Louis-Martin Gagne

unread,
Feb 5, 2017, 5:44:14 PM2/5/17
to Google App Engine
Hello everyone,

We are running into circles for some time now with this.

Our backend is all based on google endpoints using Java sessions.
Thanks to the @ApiAuth allowCookieAuth property. This is working like a charm on Android.

Now, we can't make this work on iOS.
GTLR libraries were downloaded and installed.

We would need some guidance (code excerpt, web sites, anything helpful would be appreciated) on:
1- how to retrieve cookie
2- how to send back session cookie while calling endpoints

Thanks,

LM

George (Cloud Platform Support)

unread,
Feb 6, 2017, 2:40:12 PM2/6/17
to google-a...@googlegroups.com

Hello Louis-Martin,


There is a wealth of information and step-by-step instructions in the “Using Endpoints in an iOS Client” document, referring to a more general and more recent “About Cloud Endpoints Frameworks”. Specific to Java, more detail in the com.google.api.server.spi.config document. Authorization-specific details get covered on the “Adding Authorization to the API Backend” information page. If your Endpoint requires authentication, the iOS app needs a sign-in dialog; an example is provided on this info page.  


There is a Java-specific requirement with your @ApiAuth annotation: @ApiAuth works as a sub annotation, e.g.:


@Api(auth = @ApiAuth(allowCookieAuth = AnnotationBoolean.TRUE)). By using it in this way, you make the annotation effective in your Java code.


Louis-Martin Gagne

unread,
Feb 6, 2017, 9:59:57 PM2/6/17
to Google App Engine
Hello George,

Thanks for the reply. This is already working on web and android but not on iOS.
The question is how can we send the session cookie back to the endpoint. Any ideas?

Thanks,

LM

George (Cloud Platform Support)

unread,
Feb 7, 2017, 7:19:46 PM2/7/17
to Google App Engine

Hello Louis-Martin,


Have you tried what is documented in “Using Endpoints in an iOS Client” above? What have you tried exactly, in iOS? What are the errors or what lack of functionality prevents you from implementing your app in iOS vs. success in Android? More detail would be welcome. If you want to provide information of non-public nature, you may simply send me an email.


Maybe worth mentioning: the present discussion group is for general ideas on the Google App Engine, and related problems and trends. For coding and arcane issues in specific languages and situations, you’ll be at an advantage to rather post your questions on Stackoverflow, to gain this way access to a large number of experts; it is meant for providing you help with coding.


Reply all
Reply to author
Forward
0 new messages