grsvarma019 wrote:
Hi,

I am using mod_perl2 for authentication.
That is not very specific, but I suppose that you mean that you are writing your own mod_perl authentication module ?

In this, when a request is made to a script in a particular directory, the
control will go through mod_perl authentication.
Once mod_perl returns OK as a result, we could get to the original script
that we requested.
How does that work exactly ? does it mean that your mod_perl authentication module sends a login page to the user, then when the login page is POSTed, it goes to another part of your module that handles the login, then if it is OK you re-direct to the original script URL ?

The real problem here is:

If the requested script of an application needs POST data, that data is not
being sent to the requested script ,but instead it is being captured by
apache request object of the mod_perl.
Well, that depends on the above.
If you go through another server->browser, browser->server loop before coming back to the original request, then you have a fundamental problem, but not exactly the one you probably think.


How can i pass this data to the requested script?

The problem you may run against, is that HTTP is essentially a request-oriented protocol : one request from browser, one answer from server, and then the server forgets until the next request. You cannot, in a simple way, "memorise" data on the server side between one browser request and the next.

One suggestion : have a look at the following module, from CPAN :
Apache2::AuthCookie
and more particularly at the "convert_to_get" subroutine.
That will give you an idea of one possible part of the solution.
That module in itself is also a good base to use for writing your own system. HTTP authentication can be a lot more complex than one would think at first.

Reply via email to