Tuesday, July 20, 2010

How do I add HTTP authentication and SSL to RSS feed or password proctect RSS feed using PHP?

i want to restrict access to an RSS feed, such that clients will have to enter a username and password to see the feed. I would also like to see a script that will help me request for HTTP username and password eg when you click on https://secure3.silverorange.com/rsstest...


how do i achieve this result with php.


i have already written a script that converts html form input to RSS with php.


if you don't program in php but knows how to go about this please give a clear explanation of the concept.


thanks

How do I add HTTP authentication and SSL to RSS feed or password proctect RSS feed using PHP?
Well... you could simply use Apache .htaccess protection. That's when the browser pops up a box for you to enter the username and password.





Search for: apache .htaccess password (or similar)





Or.. on the PHP Script that's producing the RSS feed.. you can check to see if they're logged-in. If they are, then serve them the normal RSS.





If they're NOT logged in, display only one RSS item in the feed, and make it a message that they must log-in firts, and make it link to your login page. When they log in, show them how to reload their RSS feed, which should then serve them complete results?





There is no mechanism in RSS itself for authentication.
Reply:The example site you provided is using HTTP authentication. For your PHP RSS feed provider, you can require a GET argument in the URL or, with some more effort at the RSS feed reader side, POST variables. See the sources for details.


No comments:

Post a Comment