473,382 Members | 1,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Handling HTTP basic authentication in script?

Hello

I have a PHP script rss.php that serves RSS to clients. It
work fine, but I'd like to server customized contents, and for this, I
need to know who the user is.

Unless there's a better way, it looks like the easiest way is to use
HTTP basic authentication:

http://en.wikipedia.org/wiki/Basic_a...ication_scheme

So I figure I should have a section in the script that starts with
prompts for a login/passwd, then fetch contents with a customized
SELECT, and format it as RSS before sending the output to the RSS
client.

Has someone written this before and could share some tips/code?

Thank you.
Jul 17 '07 #1
3 2560
Gilles Ganault wrote:
Hello

I have a PHP script rss.php that serves RSS to clients. It
work fine, but I'd like to server customized contents, and for this, I
need to know who the user is.

Unless there's a better way, it looks like the easiest way is to use
HTTP basic authentication:

http://en.wikipedia.org/wiki/Basic_a...ication_scheme

So I figure I should have a section in the script that starts with
prompts for a login/passwd, then fetch contents with a customized
SELECT, and format it as RSS before sending the output to the RSS
client.

Has someone written this before and could share some tips/code?

Thank you.
HTTP basic authentication/authorization is strictly between the browser
and the webserver. Your don't need anything in your pages.

Or you can implement your own (non-http) authentication/authorization
scheme. I've done several; there's not much to it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 18 '07 #2
Rik
On Tue, 17 Jul 2007 22:13:19 +0200, Gilles Ganault <no****@nospam.com>
wrote:
Hello

I have a PHP script rss.php that serves RSS to clients. It
work fine, but I'd like to server customized contents, and for this, I
need to know who the user is.

Unless there's a better way, it looks like the easiest way is to use
HTTP basic authentication:

http://en.wikipedia.org/wiki/Basic_a...ication_scheme

So I figure I should have a section in the script that starts with
prompts for a login/passwd, then fetch contents with a customized
SELECT, and format it as RSS before sending the output to the RSS
client.

Has someone written this before and could share some tips/code?

The manual has to come extent:

http://nl3.php.net/manual/en/features.http-auth.php

--
Rik Wasmus
Jul 18 '07 #3
C.
On 17 Jul, 21:13, Gilles Ganault <nos...@nospam.comwrote:
Hello

I have a PHP script rss.php that serves RSS to clients. It
work fine, but I'd like to server customized contents, and for this, I
need to know who the user is.

Unless there's a better way, it looks like the easiest way is to use
HTTP basic authentication:

http://en.wikipedia.org/wiki/Basic_a...ication_scheme

So I figure I should have a section in the script that starts with
prompts for a login/passwd, then fetch contents with a customized
SELECT, and format it as RSS before sending the output to the RSS
client.

Has someone written this before and could share some tips/code?

Thank you.
Alternatively you could drop a cookie from a page which handles the
input of personalization details and pick it up in your script.

Both this and the HTTP authentication approach have a fundamental flaw
though - it may not be the users browser which access the RSS feed -
there may be an intermediate rendering agent doing the fetch on their
behalf - some may be happy to retain and pass on HTTP auth stuff but I
wouldn't count on it.

A more flexible solution might be to add additional paramters with the
RSS URL....

http://example.com/rss.php?user=gilles

(my igoogle page has a horoscope on it where I can configure my star
sign - but there's something more than just RSS going on here - as far
as I can tell, it goes beyond the scope of Atom too)

HTH

C.

Jul 19 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Christian Luszick | last post by:
hi, I am concerned about the following statement in php doc on http://www.php.net/manual/en/features.http-auth.php ----- sschippp ----- As of PHP 4.3.0, in order to prevent someone from...
3
by: Steven Stern | last post by:
I'm looking for a way to force basic http autentication from within a PHP script. Here's the situation: I have an exisiting system that first authenticates people via the aMemberPro package....
0
by: conradwt | last post by:
Hi, I'm configuring a PHP script to use HTTP Basic Authentication. Thus, is it possible to test basic authentication using 'localhost'? If so, could someone send me a working .htaccess file because...
7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
1
by: Newbie | last post by:
I have set up an ASP script (with some help from microsoft.public.inetserver.asp.general!) that grabs the windows username of the user and puts it into an Access database. It is setup on IIS5 as a...
4
by: | last post by:
A Dilemma that I keep being faced with is a scenario where I require authentication on virtually everything. HTMl files, GIF files, XML files, JavaScript files and etc. And I am constantly dealing...
13
by: Patrick.O.Ige | last post by:
How can i get to redirect users if the get error 401.2 to another page? I guess i should be possible to do it in Global.asax? Or are there any better ways around it.. Any better solutions in...
3
by: Patrick Fogarty | last post by:
I am programming what is to be a web service client that will use an HTTP-POST to request and retrieve data. The remote server (written in java for what it's worth) requires basic authentication...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.