Jak napisać POST request do logowania na aspx?

0

Witam.
Od tygodnia głowie się nad zrobieniem funkcji która będzie pobierała dane ze strony dziennika elektrycznego.
Tutaj storna logowania: https://adfs.edu.gdansk.pl/adfs/ls/?wa=wsignin1.0&wtrealm=urn%3asharepoint%3agpe&wctx=https%3a%2f%2fwww.edu.gdansk.pl%2f_layouts%2fauthenticate.aspx%3fsource%3dhttps%3a%2f%2fwww.edu.gdansk.pl%2fStrony%2fGPE---Aplikacje.aspx&wreply=https%3a%2f%2fwww.edu.gdansk.pl%2f_trust%2fdefault.aspx
W końcu udało mi się przechwycić tego requesta Fiddlerem. Lecz cały czas mi się nie udaje zalogować poprawnie na strone ( Dostaje Response Code : 200 i zwraca mnie do okna logowania) . Mógłby ktoś mi powiedzieć jak napisać takiego requesta w Javie mając takie dane ?
user image
user image
user image
user image
user image
user image
Sorry za chamską cenzurę, ale pewnie ktoś mógłby spożytkować takie dane w szkodliwy sposób ;)

0

Klasy HttpDefaultClient oraz HttpPost mają takie opcje.
Ustawiasz nagłówki (metoda setHeader()) i w niej możesz przekazać. Fajnie by było gdyby ktoś udostępnił API lub prześledzić ruch co tak naprawdę idzie do strony.
Ja korzystam z burpsuite i dzięki temu widzę co wysyłam do serwera oraz co dostaję jako response

0

Coś robię źle ale nie wiem co

HttpClient client=new DefaultHttpClient();
            HttpResponse response;
            try {

                HttpPost post = new HttpPost("https://adfs.edu.gdansk.pl/adfs/ls/?wa=wsignin1.0&wtrealm=urn%3asharepoint%3agpe&wctx=https%3a%2f%2fwww.edu.gdansk.pl%2f_layouts%2fauthenticate.aspx%3fsource%3dhttps%3a%2f%2fwww.edu.gdansk.pl%2fStrony%2fGPE---Aplikacje.aspx&wreply=https%3a%2f%2fwww.edu.gdansk.pl%2f_trust%2fdefault.aspx");

                List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
                nameValuePairs
                        .add(new BasicNameValuePair("__VIEWSTATE", "%2FwEPDwULLTEyODUzMDg3OTFkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBQxTdWJtaXRCdXR0b24%3D"));
                nameValuePairs
                        .add(new BasicNameValuePair("__EVENTVALIDATION", "%2FwEWBQL%2Bt92KCALnmcnFAQLQyNvdDgLC9%2FChAwKyuOLUCw%3D%3D"));
                nameValuePairs
                        .add(new BasicNameValuePair("__db", "15"));
                nameValuePairs.add(new BasicNameValuePair("UsernameTextBox", "Moj login"));
                nameValuePairs
                        .add(new BasicNameValuePair("PasswordTextBox", "Moje hasło"));
                nameValuePairs.add(new BasicNameValuePair("SubmitButton.x", "26"));
                nameValuePairs.add(new BasicNameValuePair("SubmitButton.y","11"));
                post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
                post.setHeader("Host", "adfs.edu.gdansk.pl");
                post.setHeader("User-Agent","Mozilla/5.0 (Windows NT 6.3; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0");
                post.setHeader("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
                post.setHeader("Accept-Language","pl,en-US;q=0.7,en;q=0.3");
                post.setHeader("Accept-Encoding","gzip, deflate");
                post.setHeader("Referer","https://adfs.edu.gdansk.pl/adfs/ls/?wa=wsignin1.0&wtrealm=urn%3asharepoint%3agpe&wctx=https%3a%2f%2fwww.edu.gdansk.pl%2f_layouts%2fauthenticate.aspx%3fsource%3dhttps%3a%2f%2fwww.edu.gdansk.pl%2fStrony%2fGPE---Aplikacje.aspx&wreply=https%3a%2f%2fwww.edu.gdansk.pl%2f_trust%2fdefault.aspx");
                response = client.execute(post);
L(response.getStatusLine().toString());
                L(response.getLocale().toString());
                BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
                String line = "";
                while ((line = rd.readLine()) != null) {
                    L(line);
                    if (line.startsWith("Auth=")) {
                        String key = line.substring(5);
                        // do something with the key
                    }

                }

Dodam że respond w Fiddlerze wygląda tak:

<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="%2fadfs%2fls%2f%3fwa%3dwsignin1.0%26wtrealm%3durn%253asharepoint%253agpe%26wctx%3dhttps%253a%252f%252fwww.edu.gdansk.pl%252f_layouts%252fauthenticate.aspx%253fsource%253dhttps%253a%252f%252fwww.edu.gdansk.pl%252fStrony%252fGPE---Aplikacje.aspx%26wreply%3dhttps%253a%252f%252fwww.edu.gdansk.pl%252f_trust%252fdefault.aspx">here</a>.</h2>
</body></html>

W logach dostaje

D/Stachuj﹕ HTTP/1.1 200 OK
 D/Stachuj﹕ pl_PL
 D/Stachuj﹕ [ 11-12 22:03:37.568 19471:19569 D/Stachuj  ]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 D/Stachuj﹕ <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
D/Stachuj﹕ <head><meta http-equiv="X-UA-Compatible" content="IE=8" /><title>
D/Stachuj﹕ Błąd
D/Stachuj﹕ </title><link rel="stylesheet" type="text/css" href="MasterPages/StyleSheet.css" /><meta name="robots" content="noindex, nofollow" /></head>
D/Stachuj﹕ [ 11-12 22:03:37.583 19471:19569 D/Stachuj  ]
    <body>
D/Stachuj﹕ <form name="aspnetForm" method="post" action="/adfs/ls/?wa=wsignin1.0&amp;wtrealm=urn%3asharepoint%3agpe&amp;wctx=https%3a%2f%2fwww.edu.gdansk.pl%2f_layouts%2fauthenticate.aspx%3fsource%3dhttps%3a%2f%2fwww.edu.gdansk.pl%2fStrony%2fGPE---Aplikacje.aspx&amp;wreply=https%3a%2f%2fwww.edu.gdansk.pl%2f_trust%2fdefault.aspx" id="aspnetForm">
D/Stachuj﹕ <div>
D/Stachuj﹕ <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDasdasdas12312312MDM5ZGQ=" />
D/Stachuj﹕ </div>
D/Stachuj﹕ [ 11-12 22:03:37.583 19471:19569 D/Stachuj  ]
    <div>
D/Stachuj﹕ [ 11-12 22:03:37.583 19471:19569 D/Stachuj  ]
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wasdas123123123cnFAQ==" />
D/Stachuj﹕ </div><input type="hidden" name="__db" value="15" />
D/Stachuj﹕ <div class="MainArea">
D/Stachuj﹕ <div class="Header">
D/Stachuj﹕ <span id="ctl00_PageTitleLabel">Błąd</span>
D/Stachuj﹕ </div>
D/Stachuj﹕ [ 11-12 22:03:37.583 19471:19569 D/Stachuj  ]<div class="GroupLargeMargin">
D/Stachuj﹕ <div class="TextSizeXLarge">
D/Stachuj﹕ <span id="ctl00_STSLabel">adfs.edu.gdansk.pl</span>
 D/Stachuj﹕ </div>
D/Stachuj﹕ </div>
 D/Stachuj﹕ <div class="MainActionContainer">
D/Stachuj﹕ [ 11-12 22:03:37.583 19471:19569 D/Stachuj  ]
D/Stachuj﹕ <div class="GroupLargeMargin"><span>Wystąpił problem podczas uzyskiwania dostępu do witryny. Spróbuj ponownie przejść do tej witryny.</span></div>
D/Stachuj﹕ <div class="GroupLargeMargin"><span>Jeśli problem będzie się powtarzał, skontaktuj się z administratorem tej witryny i podaj numer odwołania, aby określić problem.</span></div>
D/Stachuj﹕ <div class="GroupLargeMargin"> </div>
D/Stachuj﹕ <div class="GroupLargeMargin"><span class="TextWeightBold"><span>Numer odwołania:</span></span> 3225eed3-3a57-485c-80a1-877eba516e1d
D/Stachuj﹕ </div>
D/Stachuj﹕ [ 11-12 22:03:37.583 19471:19569 D/Stachuj  ]
    </div>
D/Stachuj﹕ </div>
D/Stachuj﹕ </form>
D/Stachuj﹕ </body>
D/Stachuj﹕ </html>

Wydaje mi się że musze jeszcze jakoś dodać te QueryString tylko nie wiem jak

user image

zamiana znacznika <code> na <code> - @furious programming

0

Firebug widzi jakąś autoryzacje ale dużo mi to nie daje
user image

0

Czy możliwe jest że login i hasło są szyfrowane javascriptem dlatego nie udaje mi się zalogować ? Czy było by to widać fiddlerem/ Firebugiem ? Jeśli to JS szyfruje dane to jak to zrobić w Javie ?

0

Ja miałem określone w jaki sposób miałem zaszyfrować login i hasło
Base64(login:password)

0

Jest jakiś progres chodź dalej nie wiem jak to zrobić
Użyłem wtyczki HTTPRequester do Firefoxa i udało mi sie uzyskać taką transakcje

POST https://adfs.edu.gdansk.pl/adfs/ls/?wa=wsignin1.0&wtrealm=urn%3asharepoint%3agpe&wctx=https%3a%2f%2fwww.edu.gdansk.pl%2f_layouts%2fauthenticate.aspx%3fsource%3dhttps%3a%2f%2fwww.edu.gdansk.pl%2fStrony%2fGPE.aspx&wreply=https%3a%2f%2fwww.edu.gdansk.pl%2f_trust%2fdefault.aspx&__VIEWSTATE=%252FwEPDwULLTEyODUzMDg3OTFkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBQxTdWJtaXRCdXR0b24%253D%26&__EVENTVALIDATION=%252FwEWBQL%252Bt92KCALnmcnFAQLQyNvdDgLC9%252FChAwKyuOLUCw%253D%253D&__db=15&UsernameTextBox=MojLogin&PasswordTextBox=MojeHaslo&SubmitButton.x=84&SubmitButton.y=6
Host: adfs.edu.gdansk.pl
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: https://adfs.edu.gdansk.pl/adfs/ls/?wa=wsignin1.0&wtrealm=urn%3asharepoint%3agpe&wctx=https%3a%2f%2fwww.edu.gdansk.pl%2f_layouts%2fauthenticate.aspx%3fsource%3dhttps%3a%2f%2fwww.edu.gdansk.pl%2fStrony%2fGPE.aspx&wreply=https%3a%2f%2fwww.edu.gdansk.pl%2f_trust%2fdefault.aspx
Cookie: MSISLoopDetectionCookie=MjAxNC0xMS0xNToyMDowODozNFpcMQ==
Connection: keep-alive
Content-Length: 279
Content-Type: application/x-www-form-urlencoded

 -- response --
200 OK
Cache-Control:  no-cache, no-store
Pragma:  no-cache
Content-Type:  text/html; charset=utf-8
Expires:  -1
Server:  Microsoft-IIS/7.5
x-xss-protection:  0
X-AspNet-Version:  2.0.50727
Set-Cookie:  MSISSignOut=c2lnbm91dENsZWFudXA7aHR0cHMlM2ElMmYlMmZ1b25ldC5lZHUuZ2RhbnNrLnBsJTJmTG9naW5QYWdlLmFzcHgmVW9uZXQmaHR0cHMlM2ElMmYlMmZ1b25ldC5lZHUuZ2RhbnNrLnBsJTJmTG9naW5QYWdlLmFzcHgmaHR0cHMlM2ElMmYlMmZ1b25ldC5lZHUuZ2RhbnNrLnBsJTJmTG9naW5QYWdlLmFzcHhcc2lnbm91dENsZWFudXA7dXJuJTNhc2hhcmVwb2ludCUzYWdwZSZQb3J0YWwrR1BFJmh0dHBzJTNhJTJmJTJmd3d3LmVkdS5nZGFuc2sucGwlMmZfdHJ1c3QlMmZkZWZhdWx0LmFzcHgmaHR0cHMlM2ElMmYlMmZ3d3cuZWR1LmdkYW5zay5wbCUyZl90cnVzdCUyZlw=; path=/adfs/ls; secure; HttpOnly MSISAuthenticated=MjAxNC0xMS0xNSAyMTozNTo0Mw==; path=/adfs/ls; secure; HttpOnly MSISLoopDetectionCookie=MjAxNC0xMS0xNToyMTozNTo0M1pcMQ==; path=/adfs/ls; secure; HttpOnly
X-Powered-By:  ASP.NET
Date:  Sat, 15 Nov 2014 21:35:43 GMT
Content-Length:  6904

<html><head><title>Working...</title></head><body><form method="POST" name="hiddenform" action="https://www.edu.gdansk.pl/_trust/default.aspx"><input type="hidden" name="wa" value="wsignin1.0" /><input type="hidden" name="wresult" value="&lt;t:RequestSecurityTokenResponse xmlns:t=&quot;http://schemas.xmlsoap.org/ws/2005/02/trust&quot;>&lt;t:Lifetime>&lt;wsu:Created xmlns:wsu=&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;>2014-11-15T21:35:43.470Z&lt;/wsu:Created>&lt;wsu:Expires xmlns:wsu=&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;>2014-11-15T22:35:43.470Z&lt;/wsu:Expires>&lt;/t:Lifetime>&lt;wsp:AppliesTo xmlns:wsp=&quot;http://schemas.xmlsoap.org/ws/2004/09/policy&quot;>&lt;wsa:EndpointReference xmlns:wsa=&quot;http://www.w3.org/2005/08/addressing&quot;>&lt;wsa:Address>urn:sharepoint:gpe&lt;/wsa:Address>&lt;/wsa:EndpointReference>&lt;/wsp:AppliesTo>&lt;t:RequestedSecurityToken>&lt;saml:Assertion MajorVersion=&quot;1&quot; MinorVersion=&quot;1&quot; AssertionID=&quot;_18645a04-476c-4674-b01c-50854f9594d6&quot; Issuer=&quot;http://adfs.edu.gdansk.pl/adfs/services/trust&quot; IssueInstant=&quot;2014-11-15T21:35:43.485Z&quot; xmlns:saml=&quot;urn:oasis:names:tc:SAML:1.0:assertion&quot;>&lt;saml:Conditions NotBefore=&quot;2014-11-15T21:35:43.470Z&quot; NotOnOrAfter=&quot;2014-11-15T22:35:43.470Z&quot;>&lt;saml:AudienceRestrictionCondition>&lt;saml:Audience>urn:sharepoint:gpe&lt;/saml:Audience>&lt;/saml:AudienceRestrictionCondition>&lt;/saml:Conditions>&lt;saml:AttributeStatement>&lt;saml:Subject>&lt;saml:SubjectConfirmation>&lt;saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer&lt;/saml:ConfirmationMethod>&lt;/saml:SubjectConfirmation>&lt;/saml:Subject>&lt;saml:Attribute AttributeName=&quot;givenname&quot; AttributeNamespace=&quot;http://schemas.xmlsoap.org/ws/2005/05/identity/claims&quot;>&lt;saml:AttributeValue>Stanisław&lt;/saml:AttributeValue>&lt;/saml:Attribute>&lt;saml:Attribute AttributeName=&quot;surname&quot; AttributeNamespace=&quot;http://schemas.xmlsoap.org/ws/2005/05/identity/claims&quot;>&lt;saml:AttributeValue>Barański&lt;/saml:AttributeValue>&lt;/saml:Attribute>&lt;saml:Attribute AttributeName=&quot;emailaddress&quot; AttributeNamespace=&quot;http://schemas.xmlsoap.org/ws/2005/05/identity/claims&quot;>&lt;saml:AttributeValue>[email protected]&lt;/saml:AttributeValue>&lt;/saml:Attribute>&lt;saml:Attribute AttributeName=&quot;SecondaryEmail&quot; AttributeNamespace=&quot;http://schemas.vulcan.edu.pl/ws/identity/claims&quot;>&lt;saml:AttributeValue>[email protected]&lt;/saml:AttributeValue>&lt;/saml:Attribute>&lt;saml:Attribute AttributeName=&quot;PESEL&quot; AttributeNamespace=&quot;http://schemas.vulcan.edu.pl/ws/identity/claims&quot;>&lt;saml:AttributeValue>95031805252&lt;/saml:AttributeValue>&lt;/saml:Attribute>&lt;saml:Attribute AttributeName=&quot;role&quot; AttributeNamespace=&quot;http://schemas.microsoft.com/ws/2008/06/identity/claims&quot;>&lt;saml:AttributeValue>ZSL_Uczniowie&lt;/saml:AttributeValue>&lt;saml:AttributeValue>Domain Users&lt;/saml:AttributeValue>&lt;/saml:Attribute>&lt;saml:Attribute AttributeName=&quot;windowsaccountname&quot; AttributeNamespace=&quot;http://schemas.microsoft.com/ws/2008/06/identity/claims&quot;>&lt;saml:AttributeValue>MojLogin&lt;/saml:AttributeValue>&lt;/saml:Attribute>&lt;/saml:AttributeStatement>&lt;saml:AuthenticationStatement AuthenticationMethod=&quot;urn:oasis:names:tc:SAML:1.0:am:password&quot; AuthenticationInstant=&quot;2014-11-15T21:07:55.429Z&quot;>&lt;saml:Subject>&lt;saml:SubjectConfirmation>&lt;saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer&lt;/saml:ConfirmationMethod>&lt;/saml:SubjectConfirmation>&lt;/saml:Subject>&lt;/saml:AuthenticationStatement>&lt;ds:Signature xmlns:ds=&quot;http://www.w3.org/2000/09/xmldsig#&quot;>&lt;ds:SignedInfo>&lt;ds:CanonicalizationMethod Algorithm=&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;>&lt;/ds:CanonicalizationMethod>&lt;ds:SignatureMethod Algorithm=&quot;http://www.w3.org/2001/04/xmldsig-more#rsa-sha256&quot;>&lt;/ds:SignatureMethod>&lt;ds:Reference URI=&quot;#_18645a04-476c-4674-b01c-50854f9594d6&quot;>&lt;ds:Transforms>&lt;ds:Transform Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#enveloped-signature&quot;>&lt;/ds:Transform>&lt;ds:Transform Algorithm=&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;>&lt;/ds:Transform>&lt;/ds:Transforms>&lt;ds:DigestMethod Algorithm=&quot;http://www.w3.org/2001/04/xmlenc#sha256&quot;>&lt;/ds:DigestMethod>&lt;ds:DigestValue>SRYeHULRPHPiI0iDU3Ue+Mc/WSnmN7keeUGyWMkhKys=&lt;/ds:DigestValue>&lt;/ds:Reference>&lt;/ds:SignedInfo>&lt;ds:SignatureValue>ZCu1oOphInGn2Eu/Ws2ww39fYxYvdWsXzRjIdQbDK8hPdsXuFlzjQKA2t0tTpyH3I5mZlUnEv1diFTtfuotu1METBMi7ZYWUaBgHrZx//K6ivl5JQcZoWc2D29AyUxsC+f5j7P3mDg0bWED8jacbpda62IFDLe1gX88hLPwoI8ZQoBSv8x+LYlE2bBDwxinvq759A8XQdeHaKMaixzdcm2xXGcjeWJX3bmOzURUSdjZo26y8Q61ZgUH01YFjzL/GGbpOCPq3jrT8/XnncsUznxOZr8EGJmuN1gF2YAgn7sRQ/R7knFfi4SNIDCSb0psE0LtPngfuQ4c1rlxkvO28wA==&lt;/ds:SignatureValue>&lt;KeyInfo xmlns=&quot;http://www.w3.org/2000/09/xmldsig#&quot;>&lt;X509Data>&lt;X509Certificate>MIICyzCCAbMCBFJOtpgwDQYJKoZIhvcNAQEFBQAwKjELMAkGA1UEBhMCUEwxGzAZBgNVBAMMEmFkZnMuZWR1LmdkYW5zay5wbDAeFw0xMzEwMDQxMjM3NDRaFw0xODEwMDMxMjM3NDRaMCoxCzAJBgNVBAYTAlBMMRswGQYDVQQDDBJhZGZzLmVkdS5nZGFuc2sucGwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCY/VNqvUs2ZXV+oVBj7LjdRLDjhXz9tACC78yi20vd/BaO9sy8NGuwVXF421hRBEXrNjoKNx8zLk2O9+soRf57I28xuHKPY9ArNmztxBzu18NPZzOukN6jBSE1S0s+opaQR4i3FROzZRC37IB++E0KKQy609akcU7XKt4gEfJtwNCzGQLvLkj9m4yOs2auGLYpG/v+mhOUGCFYBImrQOtjiPkxL2HqwLB4ZGCnGerdymVtv8jnNExbAftgIdR66SdHggRAr4x0wQHnXrSASolzXrz0hp+Oa8C4yP77b3wzLOvAydQRZT1i9kqUFf1QWvpxIPa658L/l5JgD8+41COTAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAE8yTrjaCN+f9fKd2DUaeatacIyzfAJ2txpaYZuBcCJ9qF0Qr5Zvs7JKBXY5J6JXy3M66Vea66co9NVcb3sZrnoM47ENotRsLtiPMO+JSrHheTBw+MYAcJEovb/e6Ej5ZX81/nD/u7grh50eZRGX8wAB7gneBnxNtaNpx09hsYMYPwf6iuoscxz7LZ14DqMleqrYfhQF3Qsx4/DqDxprkawtGzxP32gMzg7pn4il8ozE9p+5D62QPJzifQVxTd138CKq8Suj7zO3BjyTLUI+vy2FQfxIJSxToOi8gn4xTyq0QTE6GRaLR738G6+w6u9cpeyQ2RURC1twfk/CrgVLPAI=&lt;/X509Certificate>&lt;/X509Data>&lt;/KeyInfo>&lt;/ds:Signature>&lt;/saml:Assertion>&lt;/t:RequestedSecurityToken>&lt;t:TokenType>urn:oasis:names:tc:SAML:1.0:assertion&lt;/t:TokenType>&lt;t:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue&lt;/t:RequestType>&lt;t:KeyType>http://schemas.xmlsoap.org/ws/2005/05/identity/NoProofKey&lt;/t:KeyType>&lt;/t:RequestSecurityTokenResponse>" /><input type="hidden" name="wctx" value="https://www.edu.gdansk.pl/_layouts/authenticate.aspx?source=https://www.edu.gdansk.pl/Strony/GPE.aspx" /><noscript><p>Script is disabled. Click Submit to continue.</p><input type="submit" value="Submit" /></noscript></form><script language="javascript">window.setTimeout('document.forms[0].submit()', 0);</script></body></html>

Lecz gdy go wysłałem ponownie otrzymałem

POST https://adfs.edu.gdansk.pl/adfs/ls/?wa=wsignin1.0&wtrealm=urn%3asharepoint%3agpe&wctx=https%3a%2f%2fwww.edu.gdansk.pl%2f_layouts%2fauthenticate.aspx%3fsource%3dhttps%3a%2f%2fwww.edu.gdansk.pl%2fStrony%2fGPE.aspx&wreply=https%3a%2f%2fwww.edu.gdansk.pl%2f_trust%2fdefault.aspx&__VIEWSTATE=%252FwEPDwULLTEyODUzMDg3OTFkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBQxTdWJtaXRCdXR0b24%253D%26&__EVENTVALIDATION=%252FwEWBQL%252Bt92KCALnmcnFAQLQyNvdDgLC9%252FChAwKyuOLUCw%253D%253D&__db=15&UsernameTextBox=MojLogin&PasswordTextBox=MojeHaslo&SubmitButton.x=84&SubmitButton.y=6
Host: adfs.edu.gdansk.pl
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: https://adfs.edu.gdansk.pl/adfs/ls/?wa=wsignin1.0&wtrealm=urn%3asharepoint%3agpe&wctx=https%3a%2f%2fwww.edu.gdansk.pl%2f_layouts%2fauthenticate.aspx%3fsource%3dhttps%3a%2f%2fwww.edu.gdansk.pl%2fStrony%2fGPE.aspx&wreply=https%3a%2f%2fwww.edu.gdansk.pl%2f_trust%2fdefault.aspx
Cookie: MSISLoopDetectionCookie=MjAxNC0xMS0xNToyMDowODozNFpcMQ==
Connection: keep-alive
Content-Length: 279
Content-Type: application/x-www-form-urlencoded

 -- response --
200 OK
Cache-Control:  no-cache
Pragma:  no-cache
Content-Type:  text/html; charset=utf-8
Expires:  -1
Server:  Microsoft-IIS/7.5
X-AspNet-Version:  2.0.50727
X-Powered-By:  ASP.NET
Date:  Sat, 15 Nov 2014 22:01:49 GMT
Content-Length:  3340



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Logowanie do systemu e-Szkoła</title>
<style type="text/css">
    html
    {
        overflow: hidden;
        /*height: 100%;*/
    }
    body
    {
        background: url('/adfs/ls/Resources/gradient-u-gory-1-piks.png') repeat-x right top; 
        height: 100%;
        width: 100%;
        padding: 0;
        margin: 0;
        font-family : Verdana;
        color : #384460;
    }
    .mainDiv
    {
        background: url('/adfs/ls/Resources/gdansk/tlo-plansza-1.jpg');
        width: 841px; 
        height: 546px; 
        margin: 0 auto;
        margin-top: 70px;
    }
    #tableUserCredentials
    {
        position: relative;
        top: 180px; 
        left: 370px;
        width: 420px
    }
</style>
</head>

<body>
    <form name="form1" method="post" action="/adfs/ls/?wa=wsignin1.0&amp;wtrealm=urn%3asharepoint%3agpe&amp;wctx=https%3a%2f%2fwww.edu.gdansk.pl%2f_layouts%2fauthenticate.aspx%3fsource%3dhttps%3a%2f%2fwww.edu.gdansk.pl%2fStrony%2fGPE.aspx&amp;wreply=https%3a%2f%2fwww.edu.gdansk.pl%2f_trust%2fdefault.aspx&amp;__VIEWSTATE=%252FwEPDwULLTEyODUzMDg3OTFkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBQxTdWJtaXRCdXR0b24%253D%26&amp;__EVENTVALIDATION=%252FwEWBQL%252Bt92KCALnmcnFAQLQyNvdDgLC9%252FChAwKyuOLUCw%253D%253D&amp;__db=15&amp;UsernameTextBox=MojLogin&amp;PasswordTextBox=Mojehaslo&amp;SubmitButton.x=84&amp;SubmitButton.y=6" id="form1" style="height: 100%;">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEyODUzMDg3OTFkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBQxTdWJtaXRCdXR0b24=" />
</div>

<div>

	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQL+t92KCALnmcnFAQLQyNvdDgLC9/ChAwKyuOLUCw==" />
</div><input type="hidden" name="__db" value="15" />
	<div class="mainDiv">
		<table class="UsernamePasswordTable" id="tableUserCredentials" cellpadding="5" cellspacing="5">
            <tr>
                <td colspan="2" style="font-size : 14px">
                    Wpisz nazwę użytkownika i hasło
                </td>
            </tr>
			<tr>
				<td align="right" nowrap="nowrap" style="font-size : 12px">
					Nazwa użytkownika:
				</td>
				<td width="100%">
					<input name="UsernameTextBox" type="text" id="UsernameTextBox" style="width:100%;" />            
				</td>
			</tr>
			<tr>
				<td align="right" style="font-size : 12px">
					Hasło:
				</td>
				<td>
					<input name="PasswordTextBox" type="password" id="PasswordTextBox" style="width:100%;" />            
				</td>
			</tr>
			<tr>
                <td>&nbsp;</td>
				<td style="font-size : 12px">
					 <a id="aUnlock" title="Pierwsze logowanie lub odzyskiwanie hasła." href="https://konta.edu.gdansk.pl/maintenance/unlock.aspx">Przywracanie dostępu do konta</a> 
				</td>
			</tr>
			<tr>
				<td colspan="2">
	                                
				</td>
			</tr>
			<tr>
				<td colspan="2" align="right">
                    <input type="image" name="SubmitButton" id="SubmitButton" src="/adfs/ls/Resources/g-zaloguj-1.png" style="border-width:0px;" />
				</td>
			</tr>
		</table>
	</div>
	</form>
</body>
</html>
 

Już nie mam żadnego pomysłu ;/

0

Udało mi się w końcu to zrobić, tylko teraz jest problem z ciasteczkami bo gdy dodam je statycznie podglądając requesty w fiddlerze, działa to do momentu wygaśnięcia sesji. Jest jakiś sposób żeby ciasteczka były dodawane dynamiczne do requestów ?

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