cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Authentication troubles (possible bug?)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 9 Mar 2001 15:40:12 +0100 (MET)

On Fri, 9 Mar 2001 earmstr2_at_csc.com wrote:

> The mail server in this place refuses to send messages to contactor.se so
> if you don't mind, I'd like continue the conversation here.

Oh. How weird. Never mind, keep it here!

> I had orginally tried to get this to work with cURL.exe for Win32. I
> never did get it work and I strong suspect the behavior that I'm seeing
> is some kind of bug (either in Extraweb or cURL). Basically, if I type
> the following into my web browser (IE 5.5with both file and session
> cookies disabled) it works:
>
>
> https://eweb01.asp.dupont.com/__extraweb__authen?data_0=USERNAME&data_1=PASSWORD&resource
> =%2FNASApp%2FCleaning_Chemicals%HelloWorldServlet&session=1292&numitems=2&method=2&s_button=%20OK%20
>
> By "works" I mean that I end up at
> https://eweb01.asp.dupont.com/NASApp/Cleaning_Chemicals/HelloWorldServlet
> after the appropriate authentication and redirection.
>
> Now, if I do the following in cURL:
>
> curl -v -i -L -b z -d "data_0=USERNAME&data_1=PASSWORD&resource
> =%2FNASApp%2FCleaning_Chemicals%HelloWorldServlet&session=1292&numitems=2&method=2&s_button=%20OK%20"
> https://eweb01.asp.dupont.com/__extraweb__authen

I hope you do realize the difference between these two approaches. The first
version you paste into the browser will make a GET request, while the second
how makes a POST request. I'd suggest you use the same method in both cases
to achieve more similar results.

To do this, you should use the full URL from example one when you use curl
and skip the -d option.

> Location: https://eweb01.asp.dupont.com:4432FCleaning_Chemicals
> Connection: close
> Content-Type: text/html
>
> * Follow to new URL: https://eweb01.asp.dupont.com:4432FCleaning_Chemicals
> * Follows Location: to new URL: 'https://eweb01.asp.dupont.com:4432FCleaning_Chemicals'
> curl: (7) Can't connect to server: 2
>
> You can see from the above that it ALMOST works. For some reason, we've
> lost the % from the %2F (forward slash) so it can't resolve the proper
> server name.

This looks like the server software is buggy. The Location: field clearly
contains a weird looking URL that curl can't possibly follow sensibly.

> I _don't_ think that this is what's happening when I use libcurl within
> PHP because I end up with a different problem (I wind up back at the
> login screen again, although if I try to login again with the same
> credentials it tells me that I'm already validated so I know that things
> are mostly working).

Switch over to a GET request and you're probably in the same place as you
were with your PHP program again.

> If you want a real userid and password to see this in action yourself I
> can e-mail you one.

Sure, mail me a userid and password and I'll have a go. I can't promise I'll
actually get anywhere though...

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
_______________________________________________
Curl-and-php mailing list
Curl-and-php_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-and-php
Received on 2001-03-09