Re: how to pass authorization to another application
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Thu, 03 Aug 2006 16:55:19 -0400
Taylor wrote:
They are not on the same server. There is no shared internal method of
communicating, so they can only interact via get/post, and cookies.
The host application will authenticate the user, and then it needs to
pass the username and something that proves they've been authenticated
by the host app to my sub-app.
You have a problem then. Web server authentication (i.e. through ..htaccess, etc.) is on a per-site basis. Your browser will not send authentication information from one server to another.
Cookies are the same way - the browser will not under normal conditions pass a cookie meant for one host on to another. Either one would be a severe security hole.
However, if the second server is a subdomain, you can use the domain parameter of setcookie() to specify the cookie will be available to all subdomains. See the PHP doc for setcookie() for more information.
However - warning. You should NOT rely on cookies for authentication. It's too easy for someone to edit the cookie (since it is sent to their machine) and authorize themselves - bypassing all of your security.
Perhaps another way (although I haven't tried) is to create a proxy on the first server and have it authenticate then pass on the request to the second one. The second server could then be set to completely block requests coming from other than the first server.
Not easy, but more secure.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- References:
- how to pass authorization to another application
- From: taylor . ettema
- Re: how to pass authorization to another application
- From: Carl Vondrick
- Re: how to pass authorization to another application
- From: Taylor
- how to pass authorization to another application
- Prev by Date: Returning a null reference in PHP 4.4.2
- Next by Date: php_zip installation problems
- Previous by thread: Re: how to pass authorization to another application
- Next by thread: Re: how to pass authorization to another application
- Index(es):
Relevant Pages
|