Ori Wasserman
Ori Wasserman

Reputation: 962

Google App Engine authentication using OAuth

There are a lot of forums and samples out there, but all of them either outdated or just not understandable.

I understand that to authenticate requests to AppEngine I need to log in to a google account using AccountManager, get a token using GoogleAuthUtil.getToken, get an AuthCookie, and than do whatever I want on the AppEngine using my token.

Now, the last 2 parts are the ones I don't understand:

  1. what is the AuthCookie? I need to get a new one every launch? is it a temporary "permission" to request authenticated requests from AppEngine? is the first token I received is a permanent one or I should get a new one every launch too?

  2. My current request is "endpoint.list().execute()". Where is the authentication comes in here? I've seen a lot of weird HTTP request samples but none of them used the AppEngine endpoints.

I'm sorry if it's too basic stuff but I really just started using the AppEngine and I couldn't find any clear explanation on how it works from beginning to end.

Thank you.

Upvotes: 2

Views: 1132

Answers (1)

Tom
Tom

Reputation: 17892

Since you are using Endpoints, have you read this?

https://developers.google.com/appengine/docs/java/endpoints/consume_android#making-authenticated-calls

It is up-to-date and I think it is reasonably clear (and it includes a sample).

I believe it is the nature of OATH that you need to get a new token for every session.

Upvotes: 2

Related Questions