I did some googling, and came to the script below,
Can anyone help /me and give a clue why this wont log me in to groups.google.com ?
#!/bin/bash
tmp=$$.tmp
EMAIL=<email>
PASSWD=<password>
curl -vv --silent https://www.google.com/accounts/ServiceLoginAuth \
--user-agent "Mozilla 5.0" \
--data-urlencode Email=$EMAIL --data-urlencode Passwd=$PASSWD \
-c cookie.tmp \
-d accountType=GOOGLE \
-d source=Google-cURL-Example \
-d service=groups2 > $tmp
auth=`grep Auth $tmp | sed 's/.*=//'`
curl --silent \
--user-agent "Mozilla 5.0" \
--header "Authorization: GoogleLogin auth=$auth" \
-b cookie.tmp \
"http://groups.google.com/group/comp.lang.javascript/topics" > $tmp>
cat $tmp
rm $tmp
I haven’t worked directly with
/ServiceLoginAuth, but from my work with/Loginand/AddSession, my guess is that you are missing some hidden form values used to secure the login.In this case, I would look at the hidden
#gaia_universalloginform and attempt to replicate the login flow:https://www.google.com/accounts/ServiceLoginAuth. It returns you a form with idgaia_universalloginthat contains login tokens.EmailandPasswdfields (like you are doing now)continueparameter (if you like) and POST the request. You will either be returned a google settings page or the continue page if you’ve logged in, or a page with another login form if you aren’t.In this case, I suspect you are missing the
dshtoken.