24 January 2010

Basic auth with Google API

Basic authentication with Google API (test with curl):

$ curl https://www.google.com/accounts/ClientLogin --data "Email=YOURGOOGLEACCOUNT&Passwd=YOURPASSWORD&service=SERVICE&accountType=GOOGLE&source=NAMEOFYOURAPP"

The SERVICE string can been obtained from: http://code.google.com/apis/gdata/faq.html#clientlogin
NAMEOFYOURAPP is a string.

If the authentication fails, normally a 403 returned with body:

Error=BadAuthentication

More error codes in: http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Errors
If works, returns a 200 with this content:

SID=XXX
LSID=XXXX
Auth=XXXX
The Auth token is the session value, Google says "You can ignore the SID and LSID values."

More info: http://code.google.com/apis/blogger/ and http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html

Posted at BinaryCell

No comments:

Post a Comment


Disclaimer: In no event shall the blog owner, be liable for any damages, including without limitation, special, indirect or consequential damages, or any damages, whatsoever resulting from access or use, or inability to access or use this Website or arising out of any materials, information, qualifications or recommendations on this Website.