cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: cURL and central authentication service

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 27 Jun 2011 15:20:10 +0200 (CEST)

On Sun, 26 Jun 2011, Anderson Ellis wrote:

> I've been looking for answers for a few days and can't really get anywhere.
> I'm still new to curl, and trying to figure out how it works exactly.
> Specifically, I want to know if it is possible to post to web page forms
> behind CAS login pages.

curl supports numerous different HTTP authentication methods and you can do
plain HTTP post logins with it. It really doesn't matter what kind of system
that is behind the site as long as it uses one of the supported methods.

> - curl -c cookies.txt -b cookies.txt -d
> "username=xxx&password=xxxx&lt=xxxxxx&_eventId=submit" pageIwant.com
>
> this returned nothing

Use -v to see the details. Use --trace-ascii to see ALL details.

> so I added the -L option, and it returned an html page that redirected to
> the cas login page.

That indicates something in your request isn't like it would be when a browser
does the request: cookies, user-agent, referer or more. Work on making your
request more similar to that of a browser doing the same thing.

A tutorial on this: http://curl.haxx.se/docs/httpscripting.html

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-06-27