![]() |
|
|
Mod Options |
LDAP Authentication Details »»
|
|||||||||
I've only recently started using vBulletin, and this is my first mod so if you use this, please click Installed!
This mod (which builds on the fine work from malcomx and zemic) is intended to lower the barriers to using and LDAP directory as an external authentication source for your board. The idea is simple; capture a login attempt before authentication and test it against LDAP first, if that succeeds, see if there is already a matching user in vBulletin. If there is not, create one, using data from the LDAP to fill in the required fields, if there is already a matching user (Determined by comparing email addresses) then update the user. You might be asking why this mod is better than the two mods I've mentioned above? Well firstly the only additional file is the XML file for the new hooks (See below), and no changes to vBulletin code so installation is simple, and upgrades to vBulletin don't get over complicated by re-applying changes. Secondly, all the settings are controlled from the admincp rather than an external config file. Thirdly (as if two wasn't enough) I've added some hook points so this mod can be extended, for example to get additional data from the LDAP and put it in user profile fields. One important similarity with the two earlier mods is that in the admincp and modcp no LDAP authentication is performed, this is a safety feature, so even if the mod or an extending to it, breaks your board, you shouldn't ever get locked out of the admincp so you'll be able to turn if off quickly. Additional Hooks The mod is essentially a single plugin (plus options and help) which runs at global_complete which is before most other things have happened, but just after all the global setup has occurred. To enable the additional hooks, you need to upload the file hooks_ldap_auth.xml to /includes/xml under your forum. The following new hooks are created by this mod:
By requesting new attributes at ldap_auth_start and then applying them at either ldap_auth_all_user, ldap_auth_new_user or ldap_auth_existing_user you can setup your users easily without having to write all the LDAP code yourself! AdminCP Settings This mod creates a new options group called LDAP Authentication between email options and user registration options where you set the host name and port number of the LDAP server, the initial authentication type (Anonymous or authenticated), optionally the BindDN and Password for the LDAP server. You also set which attribute matches the vBulletin username (The default is cn which works well for inetOrgPerson based entries). You can set additional attributes to retrieve (If you want to quickly knock up a simple plugin which uses them at one of the hook points above). There is also the facility to disable (or rather make unavailable) accounts which exist in vBulletin but not in LDAP. Given that your initial admin may fall into this group, there is also a list of userids who should be allowed to log in anyway. Requirements
I'll try to provide support to users of my mod, but please bear in mind I fairly new to all this, so I may not be able to solve all problems immediately. Support will only be provided via this thread (Don't PM or email me unless I ask you to). Priority will be given to users who have clicked Installed. Release Notes
Installation
Haqa... Download Now Only licensed members can download files, Click Here for more information. Addons Screenshots Show Your Support
The following members like this post: Jimbot
|
|||||||||
Similar Mod
|
||||
| Mod | Developer | Type | Replies | Last Post |
| vBulletin Ldap Authentication Plugin | malcolmx | vBulletin 3.6 Add-ons | 116 | 14 Apr 2011 00:05 |
| LDAP Authentication | zemic | vBulletin 3.6 Add-ons | 61 | 08 Mar 2010 22:18 |
|
#61
|
||||||||
|
||||||||
|
Originally Posted by warhau
That is because as you hit the login button the javascript in the page encrypts your password and deletes the unencypted copy (in the field) - Ever noticed that the field goes blank as you hit login? That's why. This is a sort of security feature so no one snooping on the wire can see the plain text password, however a plugin of this sort needs the plain text password to work, so if my plugin see the field empty it just gives up early because there is nothing it can do.
Originally Posted by jaikumarm
So you are basically re-running the login logic (It's also called earlier in the plugin), and this solves the problem? Cool.
May I include your patch in the next release? H. No members have liked this post.
|
||||||||
|
#62
|
|||
|
|||
|
I tried jaikumarms code: it works perfect, new users become no error message ! Thanks for that.
And special thanks to Haqa for this Mod !!! No members have liked this post.
Last edited by Blinker : 24 Apr 2009 at 12:36. |
|
#63
|
|||
|
|||
|
Originally Posted by warhau
I can't seem to get this working. I've got everything up and going with being able to log in and authenticating against LDAP. It immediately processes the login and the user's away and posting.
I can't get password changes working though. I tested it with an account, as soon as the password changes, they can't log in with the new password, they can only log in with the old password. Also, If someone changes their password through their CP, it not only breaks their old password from working, but the new one doesn't work as well. Also Also, It appears that by changing my password through the CP it has broken my ability to create new users....? EDIT For follow up: I edited the line $show['nopasswordempty'] = defined('DISABLE_PASSWORD_CLEARING') ? 1 : 0; // this nees to be an int for the templates To appear like above I was able to log in again with accounts. I don't know if this was somehow reset during my monkeying or not. Everything appears to be working now, including password changes. No members have liked this post.
Last edited by n0manarmy : 24 Apr 2009 at 17:23. |
|
#64
|
|||
|
|||
|
Ohh... hmmm
You probably want the "Disable vBulletin Users" turned on. That should (might) make it prefer the LDAP users. What you are describing with the passwords not changing is that the user update isn't working correctly. This puzzles me because it's relatively simple code, and it's working for some people. What kind of LDAP server are you reading from? Do you have access to the query logs to ensure that the user is validating and querying their entry correctly? H. No members have liked this post.
|
|
#65
|
|||
|
|||
|
Originally Posted by Haqa
Yes, that's was the idea, to trigger the re-login in-code, so that the user does not have to.
Sure, go ahead and include my patch. Thanks much for plugin, it has for sure saved me tons time. J. No members have liked this post.
|
|
#66
|
|||
|
|||
|
Thanks everyone. With the new redirect code, I can got straight in via our SOAP authentication.
I did have a problem with jaikumarm's patch code, when retaining client-side MD5 encoding. The last line "do_login_redirect()" was causing a loop and eventual PHP memory crash. This appears to be due to the global_complete hook being called in print_output in functions.php, which was looping back into the login process. In the original code, there was a line: $vbulletin->GPC['vb_login_password'] = ''; This kept the plugin from firing when global_complete was called. Without vb_login_md5password being cleared, the plugin was firing everytime it would reach "do_login_redirect()", resulting in the loop. I also notice that in jaikumarm's code, he is still using $vbulletin->GPC['vb_login_password'] in his call to verify_authentication. Theoretically, as part of the original code, isn't vb_login_password empty at this point? I'm not sure how verify_authentication would work there with a blank password. Anyway, I didn't have problem with that, but I did have to clear vb_login_md5password just prior to calling do_login_redirect, since my opening logic in the plugin prevents firing if md5 password is empty. Finally, in the original code, I noticed: $vbulletin->GPC['cookieuser'] = $vbulletin->GPC['vb_login_username']; As I was going through login.php, I noticed that it looks like cookieuser is supposed to be BOOL. Not sure this would cause any problems, but I just removed the line completely and everything works fine. Thanks to Haqa for a good example, that allowed me to write exactly what I needed, and to jaikumarm for helping to complete the puzzle! No members have liked this post.
Last edited by warhau : 29 Apr 2009 at 18:45. |
|
#67
|
||||
|
||||
|
No members have liked this post.
|
|
#68
|
|||
|
|||
|
Ahh... You haven't installed LDAP support for PHP.
H. No members have liked this post.
|
|
#69
|
||||
|
||||
|
Yah I've enabled it now. Still doesnt work when trying to log in as a test AD user. Just keeps saying invalid username /password.
I've read every page of this thread and cannot get this to work. I've follow the instructions completely, put that DEFINE piece of code in my config.php, uploaded the XML to the includes/xml dir. NOTHING. Running Win2k 2003 with AD No members have liked this post.
|
|
#70
|
|||
|
|||
|
Originally Posted by paul41598
I'm not sure about Windows, but the Centos RPM distro of PHP does not come with ldap support built in. I needed to install the php-ldap library.
Looks like there is a thread at http://forums.devshed.com/showthread.php?p=1173879 which covers installing PHP LDAP support for Windows, just in case. No members have liked this post.
|
|
#71
|
|||
|
|||
|
When I get the next release of this out attached to a better hook point I think the experience will be better. Can you put a screenshot of your settings up (Or pm me your settings) so I can take a look? It sounds like you are either not querying the correct branch of the AD's LDAP or you aren't pulling the correct attributes out.
H. No members have liked this post.
|
|
#72
|
||||
|
||||
|
Thanks for this mod Haga,
I seem to be stuck when I hit any error cases. Specifically using the vB standard_error function from within the global_complete hook causes browsers to hang when they hit this error. As a test I tried the following from the forumhome_start hook, and it was successful:
But it just wont work from global_complete... I am running vB 3.8.2. Have you come across anything like this? Thanks No members have liked this post.
|
||||
|
#73
|
|||
|
|||
|
Worked for me as well.
Thanks Kamal No members have liked this post.
|
|
#74
|
||||||||
|
||||||||
|
Originally Posted by jaikumarm
This quick fix resolved the issue related to the error around first login for the user.
No members have liked this post.
|
||||||||
|
#75
|
|||
|
|||
|
The odd thing is that I am using this on a 3.8.2 without this alteration and it appears to be working properly. Odd...
As for the errors not working, I've not experienced that either. Due to a fault in the AD replica I rely on a number of users password didn't get updated last time they changed them (It's still got their previous password), so they get login errors if they forget and use their current password. I think the best (though not necessarily the easiest) solution is to persuade Jellsoft to add a hook in the login process, as IMHO that would solve almost all the problems being reported here. I'll ask them and see what they say. H. No members have liked this post.
|
![]() |
«
Previous Mod
|
Next Mod
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
| Mod Options | |
|
|
| New To Site? | Need Help? |
All times are GMT. The time now is 14:57.





