Closed (fixed)
Project:
Webserver authentication
Version:
master
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
15 Jan 2007 at 18:52 UTC
Updated:
24 Mar 2008 at 21:52 UTC
Jump to comment: Most recent file
Comments
Comment #1
skor commentedHere's the .info
By the way, I've only tested it with Apache NTLM auth.
Comment #2
pillarsdotnet commentedHere's another, more comprehensive patch.
Works with Apache/NTLM and pgsql.
(Should work with MySQL as well...)
Comment #3
geste commentedI am assuming that use of webserver_auth LDAP features under Drupal 5.x is dependent on recently-orphaned LDAP integration module getting sorted out and updated to version 5. I see some activity on that module, but hard to tell if it is coming to a 5.x conclusion.
Comment #4
pillarsdotnet commentedgeste wrote:
No, it doesn't. However, it does rely on a working Samba installation, which is not for the faint of heart or the lacking in cluefulness...
Comment #5
geste commentedMy apologies. I was getting my modules mixed up. I have a working Samba+LDAP installation, but am using PubCookie for auth. Looking back at my 4.7, installation I see that the function I was concerned with (mapping LDAP info into Drupal profiles) is actually in ldap integration. So my question was misplaced.
Comment #6
skor commentedI have verified both of these patches work. As you can tell from the creativity of my patch, I'm not exactly qualified to comment on which is better, but either way, I'd call one of them RTBC. I'll leave it up to the module owner to decide.
Thanks Bob. Sorry it took me so long to check yours out.
Sean
Comment #7
geste commentedIt may simply be my noob cluelessness, but I had no luck with either of these patches (applied against 4.7-dev download). This was on a new Drupal 5.1 install with LDAP integration added. Maybe it ios benign, but Bob's longer patch complains of a couple chunks not processed and produced a .rej file (which I could certainly forward). When I put that patched module in place, it errs out (blank page) when I log out and try to let WebAuth take over.
Anyhow, I am curious to know if you might be on the verge of committing this as 5.x. I am thinking if I can work with a new revision, I am less likely to shoot myself in the foot, patch-wise.
I have this running with 4.7 and it is grand. Thanks. Jim
Comment #8
skor commentedAre you sure you were applying the patch agains webserver_auth 4.7 Head? When I first tried to apply it against the released 4.7, I got a few rejected hunks as well.
Comment #9
skor commentedJust to be clear, my comment #8 above applies to Bob's more extensive patch. I believe my patch was against the released 4.7 webserver auth. Although it's only a 1 character change, so you could probably just edit the module yourself, seach for "module_exist" and change it to "module_exists". Then add the .info file and it should work.
Comment #10
geste commentedSkor,
Thanks. Just to get the basics going, I tried the "simple" update again (edit 4.7 "module_exist/s" and add info). I had it choke (go blank) once when I reloaded admin page, but it is working now.
A couple of points/questions:
Under 4.7 I had one small webserver_auth admin/settings page that let me set the email domain. If that exists under 5.x I am not seeing it. So I am trying to set in webserver_auth.module webserver_auth_settings with '#default_value' => "example.com", but this is not working yet.
New users are added to Drupal, but it does not add email yet and users initially get the following set of warnings (just on first access):
warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/html/modules/user/user.module on line 361.
warning: implode() [function.implode]: Bad arguments. in /var/www/html/modules/user/user.module on line 361. user
warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /var/www/html/includes/database.mysql.inc on line 172.
This set of warnings only appeared after I added webserver_auth module.
This is on an install with ldap_integration installed (though ldap_data is not released for 5.x yet) Not sure what is interacting with user.module here -- webserver_auth or ldap_integratyion....
Thanks,
Jim
Comment #11
bdeegee commentedFWIW, I ran the patch on the HEAD version and got the same error (below) as geste did, also upon first login. I am not using ldap_integration.
* warning: array_keys() [function.array-keys]: The first argument should be an array in C:\Inetpub\wwwroot\MCB\drupal5\modules\user\user.module on line 361.
* warning: implode() [function.implode]: Bad arguments. in C:\Inetpub\wwwroot\MCB\drupal5\modules\user\user.module on line 361.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in C:\Inetpub\wwwroot\MCB\drupal5\includes\database.mysql.inc on line 172.
Comment #12
skor commentedHere's a complete copy with Bob's patch applied. Try this and see if you still have the same problem.
Comment #13
bdeegee commentedI used the above copy of the patch. No change. Still got the same error messages.
Comment #14
skor commentedThis is getting over my head, but maybe it's some interaction with another module?
My install has the following optional 5.1-dev core modules installed:
and the following contrib modules:
How about yours?
Comment #15
geste commentedFYI, I never did get the webserver_auth configuration to show up under administration, so there was nowhere to configure mail domain. However, I went back and looked at my 4.7 installation and simply added a record to"variables" table:
webserver_auth_domain s:11:"example.com";
s:11 would be replaced by s:X where X is length of email domain.
So now webserver_auth adds email when it adds new user.
Jim
Comment #16
bdeegee commentedI think I may have found the conflict with this patch: the Profiles Module.
Comment #17
cybertron1 commentedI have disabled the profile module, and I still got the errors mentioned above!!
any more ideas?
this is a great module for my intranet !!
Comment #18
cybertron1 commentedI think I know what the problem is now, I don't know how to fix it though
The problem is access roles, the user that is created get access role 0 in authmap which generates this error because access role or RID cannot be 0, it have to be either 1 or 2 (1 is anonymous, and 2 is authenticated users, and so on)
However, this is what the user.module complains about, it seem to create the user perfectly but it doesn't create the rid correctly (probably because we don't use hook_user and user_save correctly)
I am to bad at programming to know how to convert the user_default array and the $user = user_save ( kasdlaksldk) array to hook_user() and user_save()
but I believe that if we do, we'll solve these problems.
I tried to do a dbquery that updates the authmap table and inserts rid = 2 where rid = 0, but it doesn't work until the user does a refresh of the page after doing his/hers first login,so it has to be solved inside the user_save() funktion if we are going to solve this.
this is also similar to this: http://drupal.org/node/56663 node.
Comment #19
cybertron1 commentedI got it working!! Without the errors!!
Remove the line: $user = user_external_load($account->name);
and it shoudl work as expected without the sql errors
Comment #20
cybertron1 commentedok sorry guys, doesn't quite work as expected..
when I remove that line, all work great, until I try to logout, then it tries to recreate the account (which failes with a lot of sql errors)..
so I am trying to come up with a solution, but my ideas are running out, i believe the trouble is that $user is an array but when we load with user_external_load() it isn't an array anymore, but I can't figure out what to do...
Comment #21
cybertron1 commentedok, now it actually works!
no errors, the database seems fine, and this funktion is from the 4.7 version (not head) and also not the one found in this thread, but it should work with those too..
I am doing a database request to see if the user uid exist, and based on that it uses user_external_load, OR NOT!
Comment #22
freimers commentedI've been reading these emails and was not able to get webserver_auth to work.
I'm using mod_auth_mysql to authenticate to the Drupal database and needed an auto login to Drupal using the PHP basic authentication variables. Attached is the module I've called "phpauth".
You might want to look at it, I started with webserver_auth and looked at ldapauth.
It's very simple when you use the $user->name field instead of looking up the $account information and use user_authenticate.
I'm new to Drupal and don't begin to fully understand the module system.
I'm not sure why webserver_auth isn't using a password field and I have no idea what the function webserver_auth_webserver_auth is doing.
I added a phpauth_info function as it says it's required.
Although I couldn't get webserver_auth to work, it got me started in the right direction.
The attachment is a zip file that I put a .patch extension on to get it to send.
Thanks...
Comment #23
traveaux commentedHello, I'm new on Drupal. Will there be a release for drupal 5.1?
Comment #24
skor commentedChanging the issue title back to my original.
@freimers, you can easily get a CVS account to work on proposed new modules.
@traveaux, this module's author is a contributor to a lot of drupal modules, and collaborates on drupal core pretty heavily, so my guess is, he's either been very busy with other modules/projects (and for sure is busy right down trying to get stuff into core by the drupal 6.0 core code freeze July 1), or has the impression that this module isn't used much. Either way, I wouldn't expect a released 5.x version any time soon
My recommendation, if you're willing to get your hands dirty:
First - try my instructions in post #9 above to download the 4.7 version, seach for "module_exist" and change it to "module_exists". Then add the .info file from post #1 and it see if that works.
If not delete all that and download the 4.7-dev version, and apply Bob's patch from post #3.
Hopefully one of those will work for you. I'm not much of a programmer, and for webserver related reasons, I've moved on to the LDAP integration module, but post back here if you run into problems and I'll help where I can.
Comment #25
pillarsdotnet commentedCorrect typo in Title
Comment #26
moshe weitzman commentedI committed the original patches, and added a menu callback so you could use the one setting that this module offers. If there are more bugs, please file them in new issues. So sorry for the massive delay.
Comment #27
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.