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

Comments

Popular Posts