Hello Vincent,
This is a late replay and perhaps no longer needed.
I wrote the application server using Python and am so far hosting it
on my local machine. The Client Login token is fetched in a factory
class. The code is below:
class ClientLoginTokenFactory():
_token = None
def __init__(self):
self.url = '
https://www.google.com/accounts/ClientLogin'
self.account_type = 'HOSTED_OR_GOOGLE'
self.email = '
gmail.register...@gmail.com'
self.password = 'passwordForAboveAccount'
self.source = 'SOME_SOURCE_STRING'
self.service = 'ac2dm'
def get_token(self):
if(self._token is None):
values = {'accountType' : self.account_type,
'Email' : self.email,
'Passwd' : self.password,
'source' : self.source,
'service' : self.service}
data = urllib.urlencode(values)
request = urllib2.Request(self.url, data)
response = urllib2.urlopen(request)
responseAsString = response.read()
responseAsList = responseAsString.split('\n')
self._token = responseAsList[2].split('=')[1]
return self._token
The get_token method will return the token you need to insert into the
request sent to the C2DM service hosted by Google. What is required is
that your server has internet access.
Hope this helps
Regards
Tomas Malmsten
http://www.tomasmalmsten.com/
> 1. get current account TOKEN (AuthSub token) from AccountManager
> 2. start a request to server, which hosting on GAE**, with this kind of
> 3. fetch cookie from server, and use that authentication cookie in all