Http Auth: using .htaccess/.htpasswd as main source for usernames

jcummings

Joined: 2003-01-06
Posts: 20
Posted: Wed, 2009-03-04 14:11

Hiya,

I'm interested in trying to get a standalone gallery to authenticate against .htaccess/.htpasswd and use the usernames there as real users within the gallery2 context, while simultaneously still allowing public access to view the pages. That is, I want users to be able to log in with the htpasswd username and password (used with other software on the same site) and once validated for that realm be already logged-in to gallery,and user albums and such to work. (Eventually I'll be migrating an existing gallery instance over to this one, but thought I should sort this out first!)

- I've installed the HTTP Auth module and the rewrite module.
- I've tested the rewrite module (works fine)

I'm now stuck as to what I do next to enable this. On the Http Auth page I've:

- Checked "Use HTTP Authentication"
- Set the HTTP Authentication Realm to the same realm as used by other apps
- Not checked "Use Web Server Authentication", cuz I wasn't sure
- Checked "Use the authentication plugins for all modules", cuz it sounded like a good idea
- Not checked "Use Regular Expressions", cuz I'm not doing kerberos or anything

Any suggestions as to where I should go from here? I thought the http auth module would take care of the integration with gallery but it doesn't really seem to?

Best,
-James


Maintenance system information:
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.6 cgi-fcgi
Webserver = Apache/2.2.11 (Unix) PHP/4.4.9 mod_ssl/2.2.11 OpenSSL/0.9.8c mod_fastcgi/2.4.6 Phusion_Passenger/2.0.5 DAV/2 SVN/1.4.2
Database = mysqli 5.0.67-custom-log, lock.system=database
Toolkits = ArchiveUpload, Exif, Ffmpeg, jpegtran, LinkItemToolkit, NetPBM, Thumbnail, Gd, SquareThumb, ImageMagick
Acceleration = none, none
Operating system = Linux catwoman 2.6.24.5-xeon-aufs20081006-grsec #1 SMP Thu Oct 9 15:42:59 PDT 2008 x86_64
Default theme = matrix
gettext = enabled

 
jcummings

Joined: 2003-01-06
Posts: 20
Posted: Sat, 2009-03-07 10:16

Any suggestions? Surely other people must have wanted to use one login/password for gallery2 and other things....right?

Am I just missing something?

 
bensgalery
bensgalery's picture

Joined: 2009-09-10
Posts: 17
Posted: Sat, 2009-11-14 10:59

See http://gallery.menalto.com/node/78268 were I was trying to reach the same goal.
No luck yet. There must be people who got something like this going!?

When I put the whole gallery directory in a HTTP realm and in gallery on the Http Auth plugin page only check "Use Web Server Authentication" Gallery accepts the HTTP log-in.

So Gallery is listening for and accepts Server Authentication!!!!

The problem with this realm type protection is the Gallery Logout, see above thread.

Ben

 
alecmyers

Joined: 2006-08-01
Posts: 4338
Posted: Sat, 2009-11-14 16:43
Quote:
That is, I want users to be able to log in with the htpasswd username and password (used with other software on the same site) and once validated for that realm be already logged-in to gallery,and user albums and such to work.

According to members of the development team writing on this forum (http://gallery.menalto.com/node/66560#comment-241709) this is not what this module is designed for now how it works in practice. So you may be out of luck entirely.