Development by Davis |
Android C2DM — Client Login key expiration Posted: 13 Apr 2012 10:16 AM PDT [This post is by Francesco Nerieri, engineering team lead for C2DM — Tim Bray] In the upcoming weeks, some of the older Client Login authentication keys will expire. If you generated the token you're currently using to authenticate with the C2DM servers before October 2011, it will stop working. If the response from the C2DM servers contains an
We suggest that you start using the Update-Client-Auth response header to update tokens regularly, as keys will expire periodically from now on. For example, have a look at the Chrome to Phone service hosted on code.google.com; this code takes care of authenticating via Client Login and then sending a message: Alternatively, you can manually generate a new Client Login token now and replace the one currently in use. ClientLogin can be used with any application that can make an HTTPS POST request. The POST request should be structured as a form post with the default encoding application/x-www-form-urlencoded, like this: POST /accounts/ClientLogin HTTP/1.0 Content-type: application/x-www-form-urlencoded accountType=GOOGLE&Email=johndoe@gmail.com&Passwd=north23AZ&service=ac2dm If the POST succeeds, the response contains the authorization token, labeled "Auth", which is your new token. You could even do this from the command line: curl -d \ "accountType=HOSTED_OR_GOOGLE&Email=johndoe@gmail.com&Passwd=north23AZ&service=ac2dm" \ https://www.google.com/accounts/ClientLogin | \ grep Auth If your request fails or if you are prompted for captchas, please read ClientLogin for Installed Applications. And of course, if you updated your code to use the Update-Client-Auth header after the keys had expired, then you will first need to manually generate a new token. Have fun with C2DM! |
You are subscribed to email updates from Developers by Davis To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No hay comentarios:
Publicar un comentario