Re: using auth or auth_http

From: Date: Sun, 18 Feb 2007 14:32:31 +0000
Subject: Re: using auth or auth_http
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26612@lists.php.net to get a copy of this message
--- Adam Ashley <aashley@adamashley.name> wrote: > On Sat, 17 Feb 2007 06:32:02 -0800 (PST), Darren Crotchett > <back_doctor@yahoo.com> wrote: > > > > > --- Adam Ashley <aashley@adamashley.name> wrote: > > > >> On Fri, 16 Feb 2007 07:22:25 -0800 (PST), Darren Crotchett > >> <back_doctor@yahoo.com> wrote: > >> > >> > I want to be able to authenticate a user, and let that > >> authentication > >> > be persistent between pages and logins (like "Remember Me"). > I > >> have > >> > basic authentication mostly by using the examples. > >> > > >> > Any suggestions? > >> > > >> > >> Either will work for what you want. Auth is designed around a > HTML > >> > >> login form, while Auth_HTTP extends it and makes use of the > >> standard > >> HTTP authentication system. > >> > >> Adam Ashley > >> > > > > Thanks Adam. I have been able to apply both methods. But, I am > > trying to protect one page with another page (an RSS page). I > was > > hoping that by using the Auth_HTTP method that my RSS reader > would > > prompt me for a password. So far, that hasn't worked. If I > could > > figure that out, that would be awesome. Assuming that that is > not > > possible, the Auth vs. Auth_HTTP becomes fairly irrelevant. > Since > > that didn't work, I thought that I would require authentication > on > > one page that would provide access to my RSS page. I thought > Auth > > would create a session or cookie on the first page that I could > check > > for on the other page. But, when I do $myAuth->checkAuth(), in > my > > RSS file, even after authenticating on the other page, my RSS > reader > > won't load the page. I know the problem is authentication. I > put > > error message in the XML to let me know and I also checked it > with > > the "Feed Validator". > > > > I apologize that my previous post was a little vague. I got > rushed > > and didn't proof read it. > > > > Check the auth documentation for the 'allowLogin' and/or > 'displayLogin' options (assuming I'm remembering correctly). > > with one of them in it will prevent Auth from attempting to call > the > renderLogin callback function. So place that in the RSS page and it > > should only display if someone logged in. > > Although using Auth_HTTP should work fine in a RSS output as it > specifically does not send any content (unless there is a failure > to > login) it simply sets the required HTTP Headers to do the > autentication > > Adam Ashley > I researched your suggestions. I can suppress the login page, but it's not recognizing me. Let me make another couple of points. First of all, I haven't done much with sessions or cookies. So,the real problem here is probably that I don't understand them well enough and that I'm expecting too much magic from Auth. Or, I may be trying to do something with Auth that it's not even designed to do. And, that may be the real problem. OK. Here's my current page layout, trimmed down. I have a common page outside of my document root that establishes SQL and Auth objects. Then, I have two pages within my document root. These two pages share the common page by including it. I've gone back and forth between putting the myAuthObj->start() in one or both of these and/or in the common code they include. As mentioned previously, one of the 2 pages within the document root is supposed to handle the authentication and the other is just supposed to be available to that user. I guess my real question is "Is this a problem best solved with sessions or cookies?" And, is Auth equipped to handle this? If so, how? If not, which should I research? Thanks for your help and patience, Darren ____________________________________________________________________________________ Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html

« previous php.pear.general (#26612) next »