?
Solved

.htaccess authentication for 2 servers

Posted on 2006-06-04
7
Medium Priority
?
282 Views
Last Modified: 2010-03-04
Hello there,
    I was wondering if it was possible to join .htaccess auth on 2 servers. Such as, if someone had gone to server A, entered their log/pass, could they go to a .htaccess protected directory on server B without needing to re-enter (the same log/pass) again for that server.


Regards


Warren
0
Comment
Question by:undinism
5 Comments
 
LVL 57

Expert Comment

by:giltjr
ID: 16829859
Are these physically two unique server or are they the same sever just different virtual hosts?
0
 

Author Comment

by:undinism
ID: 16829877
2 physically unique servers. Both are located on the same LAN that is connected to the net.
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 16834262
I don't know of a way that they wouldn't have to re-enter the informaton on server 2; however, if the second server was entirely script driven, it isn't hard to pass the user id to the second server.  You could do so with a small script like:


#!/usr/bin/perl
use CGI qw(:standard);
$userid = $ENV{'REMOTE_USER'};
print(redirect(qq(http://www.server2.com/cgi-bin/somescript.pl?id=$userid)));
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 16834279
Let me clarify my statements.  I don't know of a way that they wouldn't have to re-enter the information using strictly .htaccess commands;  if the second server was completely script driven, though, you could pass the userid information from the first server to the second one using a script like the one that I mentioned above.
0
 
LVL 10

Accepted Solution

by:
sleep_furiously earned 500 total points
ID: 16842997
You can span authentication across different servers by using Digest authentication.

http://httpd.apache.org/docs/2.0/mod/mod_auth_digest.html

See in particular the AuthDigestDomain directive.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question