473,395 Members | 1,869 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,395 software developers and data experts.

Problem with HTTP Auth

i have a problem concerning a php script i worte some time ago.
It is a rather simple thing. On a Site you login via a html form which
points to a php that checks the username and password, and knowing this
it sends each user to his own http atuh protected directory.

i used http://user:p...@domain.com/user for each of them.

facts:
all of these directories are protected with basic auth of apache
there are pdf and other downloadable files there
and one php index page with links to the files.

problems:
ie6 sp2 does no longer support user:pass@ notation.
all other browsers do (as i know):
mozilla/firefox/epiphany/konqueror/opera/even lynx
nevertheless i'd like to support ie too

one solution is that i link to http://domain.com/user ans the browser
would ask for the username again, which is ugly

another solution is that i do not user http auth, protect the php vom
viewing, but everyone nowing a deeplink could download the files, which
i definitly don't want.

one more solution could be links to each users directory and only the
browser asks for user and pass, but no user should (in ideal case) know
that another user exists. i don't want a page (viewable for all) where
there are all users listed.

okay, ... deeplinks are also not what i wand. no user should have to
type deeplinks to his dir.

the problem is that ie does not only trow another login box, this would
be okay if other browsers work "normally". but ie gets an error
page.... syntax error. which i don't like to see.

so.: i hope the problem is clear.
i use header(Location: ???) for redirection.
i tried some hacks to include Auth credentials in the header, but had
no success.

any solution providing protection for my downloadable files, working in
all browsers would be a charm.

thanks in advance

thomas

Mar 18 '06 #1
3 1549
Th****************@gmail.com wrote:
one solution is that i link to http://domain.com/user ans the browser
would ask for the username again, which is ugly


Still, this sounds like the best solution. The problem being that the way
this works with IE, is that it remembers your input and re-sends it with
each page request that includes an authentication header.

The only thing you need to change is the "again" bit for IE users...
JW
Mar 18 '06 #2
yes, thats true but in firefox&co it also remembers and resends the
information allthough it has never been entered into the ugly browser
box, but only in my form.
and i think it is not possible to let users input the user/pass
combination twice. once into the form, and a second later into the
dialog box of the browser. this is ugly. really.

Mar 18 '06 #3
Th****************@gmail.com wrote:
i have a problem concerning a php script i worte some time ago.
It is a rather simple thing. On a Site you login via a html form which
points to a php that checks the username and password, and knowing this
it sends each user to his own http atuh protected directory.

i used http://user:p...@domain.com/user for each of them.

facts:
all of these directories are protected with basic auth of apache
there are pdf and other downloadable files there
and one php index page with links to the files.

problems:
ie6 sp2 does no longer support user:pass@ notation.
all other browsers do (as i know):
mozilla/firefox/epiphany/konqueror/opera/even lynx
nevertheless i'd like to support ie too

one solution is that i link to http://domain.com/user ans the browser
would ask for the username again, which is ugly

another solution is that i do not user http auth, protect the php vom
viewing, but everyone nowing a deeplink could download the files, which
i definitly don't want.

one more solution could be links to each users directory and only the
browser asks for user and pass, but no user should (in ideal case) know
that another user exists. i don't want a page (viewable for all) where
there are all users listed.

okay, ... deeplinks are also not what i wand. no user should have to
type deeplinks to his dir.

the problem is that ie does not only trow another login box, this would
be okay if other browsers work "normally". but ie gets an error
page.... syntax error. which i don't like to see.

so.: i hope the problem is clear.
i use header(Location: ???) for redirection.
i tried some hacks to include Auth credentials in the header, but had
no success.

any solution providing protection for my downloadable files, working in
all browsers would be a charm.

thanks in advance

thomas


One way to do it is with Apache rewrite. When the user logs in, the PHP
script adds an entry to a rewrite map, with the user's session id
pointing to his user name. When the tries to user accesses a file in
his folder, mod_rewrite would get the user's session id from the
cookie, then check to see if a matching entry in the rewrite map. If it
exists, it rewrites the url to the private folder, using the user name
from the map. If not, it sends the user to a page showing an error
message.

Mar 19 '06 #4

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

Similar topics

9
by: Bartosz Wegrzyn | last post by:
I need help with sessions. I createt set of web site for nav with authorization. first I go into main.php which looks like this: <?php //common functions include_once '../login/common.php';...
0
by: Frank Zheng | last post by:
I wrote some code to test "smtplib", but i met a problem when i call the "login(user,pass)" of the "SMTP" object. here are the codes: >>> s = smtplib.SMTP() >>> s.set_debuglevel(1) >>>...
4
by: Barry | last post by:
The MS fix for IE broke how users access our site (if they patch their browsers), so I need a solution to get users logged onto our site transparently. Basically we used to log on to the site...
2
by: Joseph Geretz | last post by:
I'm having a credentialing problem in my web application. Actually, I don't think this is an IIS security issue, since I'm able to access the page I'm requesting. However, the executing page itself...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
1
by: David Gómez Gómez | last post by:
I have a web app running con COMPUTER1 called Proyectos. In web.config i have windows integrated authentication and: <authorization> <allow users="COMPUTER1\John" /> <allow users="COMPUTER1\Liz"...
0
by: Albertas | last post by:
Hello, I have a question. But first my situation: I had a Web Service, which was written using .NET Framework 2.0, here is my code: public class Service : System.Web.Services.WebService {...
1
by: quill | last post by:
Hi I am making a chatroom script and it appears that the problem seems to be that my setTimeout's are conflicting. The logic is as follows: Run a login check every x seconds Run a trigger...
6
by: oooobs | last post by:
Hello i have deficulty to deal with cookies in PHP my website is http://kal.am cookies not working and when i tried to print session array i got the following strange output: ...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.