|
Posted by Robert Oschler on 07/25/05 00:16
I am working on a PHP 4 app that interacts with an external authorization
server. The external server does "third-party" authorization of users.
So I do the following:
1) Each of my PHP scripts has an include file (require_once) that checks to
see if the current user has recently been authorized.
2) If not, the user is "handed off" to the external server. I do this by
building the necessary URL for authorization and using refresh to perform
the redirection.
3) The external server authorizes the user by asking them to login.
4) The external server then redirects the user's browser back to a
predefined URL on my server.
I have created a MySQL database, indexed by user ID, that stores the current
URL request (to my server), the request type (GET/POST), and the GET & POST
arguments.
Before I hand the user off to the external server, I store all that
information in the database. This all works fine so far.
What I need to do now, in item 4 above, is look up the URL request info from
the database, reconstruct the GET/POST request, and redirect the user's
browser to that reconstructed destination.
All I need is some helpful code snippets to show me a clean way to
reconstruct POST requests; getting the headers right and such, and telling
the user's browser to execute/fetch that POST request. If it matters, I am
using the PEAR libraries for HTTP requests and I have no problem using
Javascript based solutions.
Does anybody have a code snippet that could save me some time here? Any
caveats or warnings?
Thanks.
Navigation:
[Reply to this message]
|