프로젝트 작업 중이며 cURL을 통해 스택 오버플로에 로그인하고 싶습니다.cURL을 사용하여 스택 오버플로로 로깅
Google을 OpenID 제공 업체로 사용하기 때문에 API를 통해 먼저 Google에 로그인해야합니다. 내가 스택 오버플로 정보를 원한다고 말해 구글에서 페이지를 얻을이 시점에서
#!/bin/sh
. ./params.sh #the script with $username and $password
curl --silent https://www.google.com/accounts/ClientLogin \
-d Email=$username -d Passwd=$password \
-d accountType=GOOGLE \
-d source=localhost-test-1 \
-d service=lso \
-o tokens
. ./tokens
echo $Auth; #$Auth is correct here - I did not get a BadAuth error.
endpoint="https://www.google.com/accounts/o8/id";
curl http://stackoverflow.com/users/authenticate \
-d "openid_identifier=$endpoint" \
-w %{redirect_url}> ./google_url
google_url=$(cat ./google_url);
echo $google_url;
echo;
echo;
echo;
curl -L --silent --header "Authorization: GoogleLogin auth=$Auth" $google_url;
내가 this page에 따르면, --header ... $Auth
부분에 로그인 할 수 있습니다. 여기
Can't call method "attr" on an undefined value at - line 8.
curl: (3) <url> malformed
--></style>
이
google2.html
의 출력은 : 나는 다음과 같은 오류가 아래의 답을하려고하면
<form id="gaia_universallogin"
action="https://www.google.com/accounts/ServiceLoginAuth?service=lso" method="post">
<input type="hidden" name="continue" id="continue"
value="https://www.google.com/accounts/o8/ud?st=SOME_KEY" />
<input type="hidden" name="service" id="service"
value="lso" />
<input type="hidden" name="dsh" id="dsh"
value="SOME_NEG_NUMBER" />
</form>
:이 스크립트를 실행할 때 다음
내가 얻는 형태이다<form id="gaia_loginform"
action="https://www.google.com/accounts/ServiceLoginAuth?service=lso" method="post" >
<input type="hidden" name="continue" id="continue" value="https://www.google.com/accounts/o8/ud?st=RNADOM" />
<input type="hidden" name="service" id="service" value="lso" />
<input type="hidden" name="dsh" id="dsh" value="NEG_NUMEBER" />
<input type="hidden" name="GALX" value="ABCD" />
<input type="text" name="Email" id="Email" />
<input type="password" name="Passwd" id="Passwd" >
<input type="checkbox" name="PersistentCookie" id="PersistentCookie" value="yes"
<input type="hidden" name='rmShown' value="1" />
<input type="submit" class="gaia le button" name="signIn" id="signIn" />
<input type="hidden" name="asts" >
</form>
컬의 UserAgent 변경을 시도해 보셨습니까? – ZyX
ZyX - 어떤 이유로 UA가 변경 되었습니까? 이 시점에서 UA 특정 코드를 제공하는 것만으로는 로그인하지 않습니다. –
PHP 사용자 에이전트로 로그인하는 것을 허용하지 않는 보안 기능을 가지고있을 수도 있습니다 ... –