cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Im getting Error Invalid referece to login page when im trying to access a protected page

From: Shafeek P.S <shafeek_ps_at_yahoo.com>
Date: Mon, 8 Mar 2004 03:48:49 +0000 (GMT)

Hi,

          I got the solution for "invalid reference to
login page when try to access the protected jsp page",
i like to share this with you people,we can solve this
problem using cookies these are the steps i followed

1.first do the login authentication like this, here
sftp/main is a protected(if you need more info
reagrding protected page please refer to
<security-constraint> tag of tomcat web.xml) page this
page you will be able to access only after successful
authentication

 curl -b cookies.txt -c cookies.txt --cacert
ca-cert.crt -d
"j_username=myname&j_password=mypassword&LoginButton=Login"
 https://<host-name>/sftp/main/j_security_check

2.After the authentication you will be able to access
which ever page you want by passing the cookies to the
server,in my case i need to access the file download
page by passing
the request parameter "Function=Download"

   curl -b cookies.txt -c cookies.txt -d
"Function=Download" --cacert ca-cert.crt
https://<host-name>/sftp/main/

if you need more info please feel free to mail me.

Thanx and Regards

Shafeek

 --- shafeek puthuparampilsayed <shafeek_ps_at_yahoo.com>
wrote: > Hi ,
>
> I am new to CURL, i have got one
> requirement
> to download files from a remote server,there one web
> application is hosted, there is one Login page is
> there once the successful login ,my request will be
> forwarded to a download page there i will be having
> links to download the files,i thought of using the
> CURL Language for this propose by simulating the
> browser,now the problem is the url im looking is a
> protected page so
> https://<remote-server>/sftp/main ,when we type this
> url the request will be internaly forwarded to a
> login page
>
>
https://<remote-server>/sftp/main/framework/Login.jsp
> ,which has got the parameter like
> j_username,j_password, & action as j_security_check
> on
> submit after the validation the request is
> forwarded to the main page
> https://<remote-server>/sftp/main/main.jsp
>
> i used the curl command like this
>
> curl -v -d
>
"j_username=myname&j_password=password&LoginButton=Login"
>
"https://<remote-server>/sftp/main/{j_security_check,main.jsp}"
>
> but when i used like this i was getting the error as
> invalid direct reference to the form login page ,
> is
> there anyway to solve this issue.........
>
> Thanx And Regards,
>
> Shafeek
>
>
>
>
>
________________________________________________________________________
> Yahoo! Messenger - Communicate instantly..."Ping"
> your friends today! Download Messenger Now
> http://uk.messenger.yahoo.com/download/index.html

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
Received on 2004-03-08