I already have my server configured and running other software, primarily Trac and SVN through webdav. Users are authenticated against an htpasswd file. I'm considering installing Drupal - is it possible to authenticate Drupal users via the htpasswd file, instead of using accounts stored in the database? This would enable a single sign on for all apps. If this is possible can I also add/remove users from the htpasswd file using Drupal?

Thanks

Comments

yelvington’s picture

Click the "Download" tab, then "Modules," then "User access/authentication." Look for the HTTP Access module.

stodge’s picture

Thanks.

Am I right in thinking that I have to configure Apache to provide httpasswd authenticate for Drupal? For example, if I have Drupal 6.x installed at /community, then I need to add something like this to Apache's config:

<LocationMatch "/community">
  AuthType Basic
  AuthName "Domain"
  AuthUserFile /srv/.htpasswd
  Require valid-user
</LocationMatch>

I think I have it configured correctly - when I visit /community a dialog appears requesting a login. I can login with my own account, though I have a Drupal account and my details are also in the htpasswd file. The logout button doesn't appear to do anything. I can't login with any other users defined in the htpasswd file who don't have Drupal account. So do user need Drupal accounts as well?

Thanks again

stodge’s picture

Ok I understand a bit better now. I can use webserver_auth to authenticate the whole site against an htpasswd file. However, I want to let guests to read the site content and I only want to force a login for people who create content. Any ideas how to do this?

Thanks

deumatasha’s picture

May I ask how do you use webserver_auth to authenticate teh whole site against an htpasswd file? I need to do the same.