R: Help!! I"m stuck! - using LWP for single sign on purposes

R: Help!! I"m stuck! - using LWP for single sign on purposes

am 01.03.2005 09:14:22 von asetti

Thank you for the answer.

I had a look th WWW::Mechanize and it does almost everything that i =
need.

The only thing i cannot understand is: how can i forward the cookie to =
the
real browser?
I need to fetch it from the real login page and then forward it to the
referrer...

-----Messaggio originale-----
Da: Bret Swedeen [mailto:bret@pobox.com]=20
Inviato: luned=EC 28 febbraio 2005 19.39
A: Andrea Setti
Oggetto: Re: Help!! I'm stuck! - using LWP for single sign on purposes

As Andy Lester mentioned in his previous response...use WWW::Mechanize =
as it
will make this type of task much easier. Also, since you are =
authenicating
with a username and password, that transaction might occur over https. =
In
that case you will also need the mod Crypt::SSLeay to handle the SSL =
piece
of communication. =20
Finally, don't forget to enable cookies in your code. Near the top add =
the
line "use HTTP::Cookies;" Spend some time with WWW::Mechanize, it is =
well
worth the time spent.


On 28 Feb 2005 at 15:51, Andrea Setti wrote:

> hi list!
>=20
> i need your help:
>=20
> i use LWP to fetch a login page, that i need to fill out and re-send=20
> to the server in order to authenticate an user in a Single Sign-On=20
> environment.
>=20
> i need to fetch some input type's values from the original login page, =

> put username & password and then send everything via POST to the=20
> server.
>=20
> i have two problems:
>=20
> 1. how can i make a post request?
> 2. when i fetch data, i also need to fetch a cookie, that contains the =

> session ID.how can i "foward" it to the browser?
>=20
> thanks a lot!!
>=20
>=20
>=20

Re: R: Help!! I"m stuck! - using LWP for single sign on purposes

am 01.03.2005 09:36:24 von peter.stevens

--------------060209010204060703040308
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Dear Andrea,

HTTP::Cookies has two submodules. one for Mozilla browsers and one for=20
Microsoft browsers. Unfortunately the MS version does not support saving =

the cookies. (BTW - everybody knows, Firefox is the better browser ;-) ).=


I have not used these modules, just found them on cpan. If you have not=20
already discovered it, search.cpan.org is an excellent way to find the=20
modules you need (although wading through the volume can be a bit of a=20
challenge). A search for Cookies Microsoft produces over a thousand=20
results, perhaps one of them will be useful...

Cheers & Good Luck

Peter

Andrea Setti wrote:

>Thank you for the answer.
>
>I had a look th WWW::Mechanize and it does almost everything that i need=

>
>The only thing i cannot understand is: how can i forward the cookie to t=
he
>real browser?
>I need to fetch it from the real login page and then forward it to the
>referrer...
>
>-----Messaggio originale-----
>Da: Bret Swedeen [mailto:bret@pobox.com]=20
>Inviato: luned=EC 28 febbraio 2005 19.39
>A: Andrea Setti
>Oggetto: Re: Help!! I'm stuck! - using LWP for single sign on purposes
>
>As Andy Lester mentioned in his previous response...use WWW::Mechanize a=
s it
>will make this type of task much easier. Also, since you are authenicat=
ing
>with a username and password, that transaction might occur over https. =
In
>that case you will also need the mod Crypt::SSLeay to handle the SSL pie=
ce
>of communication. =20
>Finally, don't forget to enable cookies in your code. Near the top add =
the
>line "use HTTP::Cookies;" Spend some time with WWW::Mechanize, it is we=
ll
>worth the time spent.
>
>
>On 28 Feb 2005 at 15:51, Andrea Setti wrote:
>
> =20
>
>>hi list!
>>
>>i need your help:
>>
>>i use LWP to fetch a login page, that i need to fill out and re-send=20
>>to the server in order to authenticate an user in a Single Sign-On=20
>>environment.
>>
>>i need to fetch some input type's values from the original login page, =

>>put username & password and then send everything via POST to the=20
>>server.
>>
>>i have two problems:
>>
>>1. how can i make a post request?
>>2. when i fetch data, i also need to fetch a cookie, that contains the =

>>session ID.how can i "foward" it to the browser?
>>
>>thanks a lot!!
>>
>>
>>
>> =20
>>
>
>
>
>
>
> =20
>

--=20
------------------------------------------------------------ ----------
Peter Stevens Phone: +41 43 535 8517
www.MinuteWatcher.com Fax: +41 44 544 8392


--------------060209010204060703040308--

Re: R: Help!! I"m stuck! - using LWP for single sign on purposes

am 01.03.2005 13:46:04 von jjl

On Tue, 1 Mar 2005, Peter Stevens wrote:

> HTTP::Cookies has two submodules. one for Mozilla browsers and one for
> Microsoft browsers. Unfortunately the MS version does not support saving
> the cookies. (BTW - everybody knows, Firefox is the better browser ;-) ).
[...]

Those are only needed if you want to interoperate with those browsers.
Use HTTP::Cookies itself otherwise.


John

Re: R: Help!! I"m stuck! - using LWP for single sign on purposes

am 01.03.2005 13:49:55 von jjl

On Tue, 1 Mar 2005, Andrea Setti wrote:

> Thank you for the answer.
>
> I had a look th WWW::Mechanize and it does almost everything that i need.
>
> The only thing i cannot understand is: how can i forward the cookie to the
> real browser?
> I need to fetch it from the real login page and then forward it to the
> referrer...
[...]

You don't have to forward the cookies explicitly -- it's all done under
the covers automatically. You just have to make sure it's switched on.

I don't recall if cookie handling is on by default in mechanize, though.
I would imagine so, but don't trust me: read the docs.


John