in reply to Passing a 401 header with CGI.pm ?

I'm a bit confused...accessing websites is done via the LWP module, not CGI. There have been many threads about this (try Hitting a web page).

CGI can send a header, but CGI is sent to the client, not to a website.

Update: Oh! a redirect, sorry, didn't read while brain was engaged. You don't want a 401 header (that's Requires Authorization), you want something more like a 302 (moved). Details won't matter CGI.pm can redirect with...redirect(). It's just a matter of finding what parameters to ask for. Lemmee root around the docs...

Replies are listed 'Best First'.
Re: Re: Passing a 401 header with CGI.pm ?
by arturo (Vicar) on Dec 02, 2000 at 01:39 UTC

    I don't think it's just the redirect ... it seems that what he wants is something that will authorize the client in a non-standard manner. Personally, I'd think you need a pretty fancy solution for that (e.g. a mod_perl enabled server with a custom authentication handler; you'd set a cookie at some point, and the handler would read the cookie and if not present, restrict access).

    But there are many bright people here, I suppose they can come up with something less drastic.

    Philosophy can be made out of anything. Or less -- Jerry A. Fodor

      I think the issue is how the whole redirection trick works. If the browser does all the work, and the protocol allows you to pass the necessary authorization fields, it could happen. (Unfortunately, I don't know the answers to those questions).

      I've dug around in the CGI.pm code, and the redirect() function will pass additional arguments along, so that will work. It's just a matter of finding out IF such arguments exist, and if so, what they are.