Logowanie na stronę - problem :(

0

Mam problem z zalogowaniem się na stronę: heyahklub.pl . Snifując mam takie coś:

http://www.heyahklub.pl/sso2/authenticate.do

POST /sso2/authenticate.do HTTP/1.1
Host: www.heyahklub.pl
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: pl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.heyahklub.pl/sso2/r_login.do?turl=http%3A%2F%2Fwww.heyahklub.pl%3A80%2Fhk%2Fportal%2Fproxy%3FparentUrl%3D%2Fhk%2Fportal%2FprivatePortal.do%26myUrl%3D%2Fhk%2Fportal%2FwelcomeFriend.do%26sn%3DHEYAH.PORTAL&partnerlogin=heyah
Cookie: JSESSIONID=L3cpmyLcGJGZHv1Fpb2nLG0JMs4dX1QLzt2sw2bxy3jxDQlhSVbC!-419379306
Content-Type: application/x-www-form-urlencoded
Content-Length: 114
org.apache.struts.taglib.html.TOKEN=e8c9578b837d415f626a847a41a14ce2&login=48TUNUMER&password=TUHASLO&x=47&y=15
HTTP/1.x 302 Moved Temporarily
Date: Fri, 11 Jul 2008 13:16:00 GMT
Server: Apache
Pragma: No-cache
Location: http://www.heyahklub.pl:80/hk/portal/proxy?parentUrl=/hk/portal/privatePortal.do&myUrl=/hk/portal/welcomeFriend.do&sn=HEYAH.PORTAL
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Info-login: Auth weak
Info-redirect: Manualy changed
Cache-Control: no-cache,no-store,max-age=0
Content-Length: 0
Keep-Alive: timeout=3, max=255
Connection: Keep-Alive
Content-Type: text/vnd.wap.wml
Content-Language: pl
----------------------------------------------------------
http://www.heyahklub.pl/hk/portal/proxy?parentUrl=/hk/portal/privatePortal.do&myUrl=/hk/portal/welcomeFriend.do&sn=HEYAH.PORTAL

GET /hk/portal/proxy?parentUrl=/hk/portal/privatePortal.do&myUrl=/hk/portal/welcomeFriend.do&sn=HEYAH.PORTAL HTTP/1.1
Host: www.heyahklub.pl:80
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: pl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.heyahklub.pl/sso2/r_login.do?turl=http%3A%2F%2Fwww.heyahklub.pl%3A80%2Fhk%2Fportal%2Fproxy%3FparentUrl%3D%2Fhk%2Fportal%2FprivatePortal.do%26myUrl%3D%2Fhk%2Fportal%2FwelcomeFriend.do%26sn%3DHEYAH.PORTAL&partnerlogin=heyah
Cookie: JSESSIONID=L3cpmyLcGJGZHv1Fpb2nLG0JMs4dX1QLzt2sw2bxy3jxDQlhSVbC!-419379306

HTTP/1.x 200 OK
Date: Fri, 11 Jul 2008 13:16:01 GMT
Server: Apache
Content-Length: 220
Keep-Alive: timeout=3, max=254
Connection: Keep-Alive
Content-Type: text/html; charset=ISO-8859-2
Content-Language: pl

I w Delphi wymociłem coś takiego:

procedure TForm1.Button1Click(Sender: TObject);
var
Input, OutPut : TStringStream;
begin
input:=tstringstream.Create('');
output:=tstringstream.Create('');
try
Input.WriteString(Format('login=%s&passwor=%s&x=47&y=15', [edit1.Text, edit2.Text]));
IdHTTP1.Request.UserAgent := 'Mozilla/5.0 (Windows; U; Windows NT 5.0; pl-PL; rv:1.7.6) Gecko/20050226 Firefox/1.0.1';
IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
IdHTTP1.HandleRedirects:=True;
IdHTTP1.Post('http://www.heyahklub.pl/sso2/r_login.do?turl=http%3A%2F%2Fwww.heyahklub.pl%3A80%2Fhk%2Fportal%2Fproxy%3FparentUrl%3D%2Fhk%2Fportal%2FprivatePortal.do%26myUrl%3D%2Fhk%2Fportal%2FwelcomeFriend.do%26sn%3DHEYAH.PORTAL&partnerlogin=heyah', Input, Output);
IdHTTP1.Connect;
if output.datastring <>'' then begin
Memo1.Text:=output.datastring;
end;
finally
Input.Free;
Output.Free;
end;
end;

Co robię źle, że to mi nie chodzi? Wiem, że pewnie jakieś cookie trzeba (czy coś takiego :P), ale niestety nie znam się na tym :(. Teraz wyskakuje mi błąd "Already connected". Pomoże ktoś? Naprawdę nie znam się na tym i nie wiem od czego zacząć :( Chcę po prostu zalogować się na ten serwis, a kod źródłowy strony po logowaniu wyświetlić w komponencie Memo. Bardzo proszę po pomoc...

0

IdCookieManager na forme i podpiac do IdHttp

0
pomooocy napisał(a)
try
Input.WriteString(Format('login=%s&passwor=%s&x=47&y=15', [edit1.Text, edit2.Text]));

Powinno być "password".
Co do cookiemanager`a, to jest zaimplementowany już w samym komponencie IdHTTP, przynajmniej w wersji 10 Indy.

0

czy ktos moglby mi powiedziec skad wziasc takie cos

http://www.heyahklub.pl/sso2/authenticate.do

POST /sso2/authenticate.do HTTP/1.1
Host: www.heyahklub.pl
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: pl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.heyahklub.pl/sso2/r_login.do?turl=http%3A%2F%2Fwww.heyahklub.pl%3A80%2Fhk%2Fportal%2Fproxy%3FparentUrl%3D%2Fhk%2Fportal%2FprivatePortal.do%26myUrl%3D%2Fhk%2Fportal%2FwelcomeFriend.do%26sn%3DHEYAH.PORTAL&partnerlogin=heyah
Cookie: JSESSIONID=L3cpmyLcGJGZHv1Fpb2nLG0JMs4dX1QLzt2sw2bxy3jxDQlhSVbC!-419379306
Content-Type: application/x-www-form-urlencoded
Content-Length: 114
org.apache.struts.taglib.html.TOKEN=e8c9578b837d415f626a847a41a14ce2&login=48TUNUMER&password=TUHASLO&x=47&y=15
HTTP/1.x 302 Moved Temporarily
Date: Fri, 11 Jul 2008 13:16:00 GMT
Server: Apache
Pragma: No-cache
Location: http://www.heyahklub.pl:80/hk/portal/proxy?parentUrl=/hk/portal/privatePortal.do&myUrl=/hk/portal/welcomeFriend.do&sn=HEYAH.PORTAL
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Info-login: Auth weak
Info-redirect: Manualy changed
Cache-Control: no-cache,no-store,max-age=0
Content-Length: 0
Keep-Alive: timeout=3, max=255
Connection: Keep-Alive
Content-Type: text/vnd.wap.wml
Content-Language: pl
----------------------------------------------------------
http://www.heyahklub.pl/hk/portal/proxy?parentUrl=/hk/portal/privatePortal.do&myUrl=/hk/portal/welcomeFriend.do&sn=HEYAH.PORTAL

GET /hk/portal/proxy?parentUrl=/hk/portal/privatePortal.do&myUrl=/hk/portal/welcomeFriend.do&sn=HEYAH.PORTAL HTTP/1.1
Host: www.heyahklub.pl:80
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: pl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.heyahklub.pl/sso2/r_login.do?turl=http%3A%2F%2Fwww.heyahklub.pl%3A80%2Fhk%2Fportal%2Fproxy%3FparentUrl%3D%2Fhk%2Fportal%2FprivatePortal.do%26myUrl%3D%2Fhk%2Fportal%2FwelcomeFriend.do%26sn%3DHEYAH.PORTAL&partnerlogin=heyah
Cookie: JSESSIONID=L3cpmyLcGJGZHv1Fpb2nLG0JMs4dX1QLzt2sw2bxy3jxDQlhSVbC!-419379306

HTTP/1.x 200 OK
Date: Fri, 11 Jul 2008 13:16:01 GMT
Server: Apache
Content-Length: 220
Keep-Alive: timeout=3, max=254
Connection: Keep-Alive
Content-Type: text/html; charset=ISO-8859-2
Content-Language: pl

dla onetu?

0

np program HTTPAnalyzer

1 użytkowników online, w tym zalogowanych: 0, gości: 1