Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm setting up a basic test environment to test drive multiple sites I co-maintain with a colleague.

What I am trying to achieve is to password protect the entire domain with basic auth. This is working, but the problem is that for every subomain you need to reauth yourself. Which, to say the least, is pretty annoying since there are at least 30 subdomains in use at the moment.

Is it possible to transfer the basic auth session across multiple subdomains?

I know I can try to rewrite it all to use a different kind of auth but basic auth is a lot easier to set up.

I am using apache and these are the rules I am using for basic auth:

AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /svn/authz
Require valid-user
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

These answers provide a way to share authentification across multiple subdomains: Apache .htaccess trick to authenticate only once for all subdomains? and http://stackoverflow.com/questions/339244/using-apaches-mod-auth-across-multiple-sub-domains-for-single-sign-on

However the subdomains have to be listed explicitely, it won't work with wildcards (which is frustrating because I have a domain with 350+ subdomains I would like to share authentification for).

share|improve this answer
    
Yeah, the amount of subdomains is expected to grow to at least 100 as well, but the solution does work. Even though in the end we decided to go for ip based authentication (192.168.*.*) always gets access and some dedicated IP's, for the rest basic auth that needs you to resign in every subdomain.. –  gnur May 31 '11 at 9:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.