I have a domain that a small private group of people will access. Therefore, I want to control access through authentication.
The domain has a set of installed applications, each of which has its own subdomain. For example: domain.com, app1.domain.com, app2.domain.com, app3.domain.com
I would like to have one login solution so that they cannot be authenticated for each application. In addition, applications are written in different languages ββ(PHP, Python and Perl), so user authentication through the Apache module is ideal.
I'm new to digesting authentication, but this seems like a good solution. I used htdigest to create my users. I configured my domain and subdomains (see below).
If I go to a domain or any of the subdomains, he will offer to enter a username and password. If I enter the correct username and password, it will authenticate me and the page will load. However, if I move to another subdomain, he will ask me to enter my username and password again. If I enter the same username and password, it will work.
So, the password file is fine, and authentication is fine, but the problem seems to be the configuration of AuthDigestDomain .
I searched all over the network to find an example of using Digest authentication for multiple domains, but I cannot find a specific example that solves my problem.
I hope someone here can help. Do I put the same authentication information in every Directory ? Should I use Directory or Location or Files ? Did I miss something together?
Thanks in advance!
The following is an example of my Apache configuration for domain.com:
<Directory /var/www> AuthType Digest AuthName "realm" AuthDigestAlgorithm MD5 AuthDigestDomain / http://domain.com/ http://app1.domain.com/ http://app2.domain.com/ http://app3.domain.com/ AuthDigestNcCheck Off AuthDigestNonceLifetime 0 AuthDigestQop auth AuthDigestProvider file AuthUserFile /etc/apache2/.htpasswd-digest AuthGroupFile /dev/null Require valid-user </Directory>
And here is an example of app1.domain.com:
<Directory /var/lib/app1> AuthType Digest AuthName "realm" AuthDigestAlgorithm MD5 AuthDigestDomain / http://domain.com/ http://app1.domain.com/ http://app2.domain.com/ http://app3.domain.com/ AuthDigestNcCheck Off AuthDigestNonceLifetime 0 AuthDigestQop auth AuthDigestProvider file AuthUserFile /etc/apache2/.htpasswd-digest AuthGroupFile /dev/null Require valid-user </Directory>
To further distort the situation, this works when using IE6, but not Firefox or Chrome. Are clients that do not send authentication properly, or is this server not sending the correct credentials?
I also read RFC 2617 and wrote authentication headers using PHP to ensure that the request / response is correct. It did not help!