开发者

querying Google.Groups

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 /Login and /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_universallogin form and attempt to replicate the login flow:

  1. Hit https://www.google.com/accounts/ServiceLoginAuth. It returns you a form with id gaia_universallogin that contains login tokens.
  2. Set the POST data to reflect each header of that form, as well as the Email and Passwd fields (like you are doing now)
  3. Set the continue parameter (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 dsh token.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜