curl-users
Re: telia.se login
Date: Tue, 04 Oct 2005 20:51:32 +0200
Ive managed to get the cookie working and i now get the login page. But im not sure how to do the post. Ive tried but it doesnt work.
curl -L -b cookies -c cookies -o login.html https://komc.tewss.telia.se/adressbok/db/pck_html_Kontakt.starta -d "user=ME&password=MyPW"
Here is the form i want to post.
<FORM name="login" method="POST" action="/ssotcwss/login">
<INPUT type='hidden' name='auth_mode' value='basic'/>
<INPUT type='hidden' name='ct_orig_uri' value='https://komc.tewss.telia.se:443/adressbok/db/pck_html_Kontakt.starta'>
<TABLE><TR><TD vAlign=top><B>Användarnamn:*</B></TD>
<TD><INPUT type="text" size="32" style="width=150" maxlength="32" name="user" value="" ><BR><SPAN class=contentblue>Småbokstäver a-z, siffror 0-9 samt _ ärtillåtet.</SPAN><BR></TD></TR>
<TR><TD vAlign=top><B>Lösenord:*</B></TD>
<TD><INPUT type="password" size="32" style="width=150" maxlength="32" name="password" value=""><BR><SPAN class=contentblue>Minst 6 tecken, små eller stora bokstäver a-z, siffror 0-9 samt _ är tillåtet.</SPAN><BR></TD></TR>
<TR><TD><IMG src="/images/p.gif" width=1></TD>
<TD><input type=image height=19 alt="Logga in" src="/img/buttons/button_loggain.gif" width=63 align=right border=0></TD></TR>
</TABLE>
</FORM>
https://access.tewss.telia.se/ssotcwss/login
POST /ssotcwss/login HTTP/1.1
Host: access.tewss.telia.se
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
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: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: https://access.tewss.telia.se/servlet/tcwss-login/login.jsp?CT_ORIG_URL=https%3A%2F%2Fkomc.tewss.telia.se%3A443%2Fadressbok%2Fdb%2Fpck_html_Kontakt.starta&ct_orig_uri=%2Fadressbok%2Fdb%2Fpck_html_Kontakt.starta
Cookie: JSESSIONID=D8Mwr1tbXWpmkcv7Rm3L2dxM2YWRJ1hynVYLG9bpL4n8Y2QyjCvz!526028274
Content-Type: application/x-www-form-urlencoded
Content-Length: 155
auth_mode=basic&ct_orig_uri=https%3A%2F%2Fkomc.tewss.telia.se%3A443%2Fadressbok%2Fdb%2Fpck_html_Kontakt.starta&user=ME&password=PW&x=43&y=18
HTTP/1.x 302 Moved Temporarily
Date: Thu, 29 Sep 2005 15:47:22 GMT
Server: Apache
Location: https://komc.tewss.telia.se:443/adressbok/db/pck_html_Kontakt.starta
Set-Cookie: CTSESSION=AAAAAQABAEiU/AMJWG8Uk15YnKyDwxM/uuTQ/8Eo3LJD3gYDS6O5HZc3dOoXROIWi7GF9reG8XbE0c8JU4mqDtjIN7zT+diwXSmwFNmenAY=; domain=.tewss.telia.se; path=/; secure
Set-Cookie: FULLNAME=ME; domain=.tewss.telia.se; path=/
P3P: CP='NOI IND COM NAV CURa OUR'
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/plain; charset=ISO-8859-1
On Thu, 29 Sep 2005 13:55:45 +0200, Daniel Stenberg <daniel-curl_at_haxx.se> wrote:
> On Thu, 29 Sep 2005, zEUZ wrote:
>
>> curl -d "username=ME&password=MyPW"
>> https://komc.tewss.telia.se:443/adressbok/db/pck_html_Kontakt.starta
>
> Ok, then you could proceed with:
>
> Add -L to make curl follow locations and
>
> Add "-b -" to activate curl's built-in cookie parser.
>
> Add "--trace-ascii dump" to get a full trace of what happened to make it
> easier to understand exactly what happened and what didn't.
>
> But, I would advice that you first use LiveHTTPHeaders to track down exactly
> what your browser does. It isn't unlikely that you need to first get the login
> page to collected some cookies and _then_ do the post. Many sites work that
> way.
>
Received on 2005-10-04