Thank you, Trung. This was a big help! It seems that I was on the right
track, the code only needed some polishing.
I've checked the code, it was pretty similar to mine, so I've just
changed one thing, and it is now working.
For anyone having the same issue: try to inline the get parameters,
like in the code above, or this:
HttpGet get = new
HttpGet("http://yourapp.appspot.com/_ah/login?continue="+URLEncoder.encode("http://yourapp.appspot.com/")+"&auth="+auth.substring(5));
Where auth is the String from the first request, starting with: "Auth:"
A few other possible pitfalls I've seen:
- If the first url is wrong (should be:
https://www.google.com/accounts/ClientLogin) you will get cookies in
the reply, a well known one is "PREF=ID=.."
- The information that you send in should be the body of the "post"
call for the first request, and "get" parameters in the second.
- The Auth string from the first call comes back as content (in the
body), not as header/cookie
- For the second call, it's better to turn off redirect following
- You don't need a CookieManager to capture the cookie. You can just
look for "Set-Cookie" in the headers
- The expiry date of the cookie depends on your GAE app settings. The
default is one day, you can change it to 1 or 2 weeks.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.