The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
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
Show Your Support
|
Благодарность от: | ||
Jimbot |
Comments |
#122
|
|||
|
|||
Quote:
I have the same behavior as you, "You have entered an invalid username or password". I had been receiving an error that the initial bind failed, but now I don't even receive this error. |
#123
|
|||
|
|||
Attached are the cumulative changes/updates for product-ldap_auth-1.5.xml provided by cowbert and john.parlane for running in version 4 so you don't have to update it by hand yourself. Thanks to all who have made this possible!
Also, make sure you install the php-ldap package via yum if you are running Linux, and then restart your apache server after you've installed it. e.g. > yum install php-ldap > restart apache Cheers, Jim |
#124
|
|||
|
|||
changed vbull.user to forum.user in the user database query lookup so it will properly look up existing users
|
#125
|
|||
|
|||
Quote:
Big thanks, Gina |
#126
|
|||
|
|||
I'm having issues getting this working with our setup.
vBulletin 3.8.2 Openldap (linux debian) php 5 product-ldap_auth-1.5.xml It is binding ok, but setting Naming Attribute to what we use in the OU - "uid" it isn't picking up the username. Full Name Support for LDAP Auth - seems to work, using the same username on vbulletin database as it is in the ldap database. Just can't login with users using ldap auth details, also the mod isnt disabling vbulletin users. |
#127
|
|||
|
|||
Quote:
Code:
define('DISABLE_PASSWORD_CLEARING', 1); How can I make any errors with this output to a log? I would like to better diagnose my failures. |
#128
|
|||
|
|||
There is a lot of good information scattered around this thread for connecting this plugin to Active Directory. In the interest of making things a bit more clear, here are the additional steps required for connecting to Active Directory:
Active Directory: You need a user to query Active Directory Firewall: Don't forget to open firewall ports for authentication if you are working with a DMZ or the like. LDAP Authentication Settings in vBulletin: Anonymous Bind: No Bind DN: <Domain>\<Username> Naming Attribute: sAMAccountName Search Base DN: OU=<Whatever>,DC=<your_domain>,DC=<your_domain_tld > LDAP Attributes: fullName, mail, sAMAccountName Some points to keep in mind: 1. This plugin doesn't seem to work if your Search Base DN begins with a DN in AD. You must have your search base begin with an OU. This means that if you have multiple OU's at the top level of AD that contain users, you may have a problem. 2. The Bind DN should be passed in the format shown above. 3. Make sure to download product-ldap_auth-1.5_vb4.xml found in this thread, not the one from Haqa's original post. This version contains patches needed for vBulletin 4. 4. The product-ldap_auth-1.5_vb4.xml code attached to this post has a change so that you do not have to specify your DB name: Code:
$dbuserinfo = $vbulletin->db->query_first_slave("SELECT password FROM ".TABLE_PREFIX."user WHERE username = '$username'"); Anything else? Thanks, Kirk. |
Благодарность от: | ||
Jimbot |
#129
|
||||
|
||||
Awesome plugin, one request though, how can I set it to give the LDAP users specific usergroup(s) by default?
|
#130
|
|||
|
|||
Okay so I needed to use this for a setup that we have using Active Directory. Kirk's (KPatten) version was great, but being a hacker at heart I tweaked it. I thought I'd share this with the community as a way to say thanks. All the caveats and instructions that Kirk gave in post 127 still apply.
Differences:
For this to work you'll need the following files. They go in the following locations: ./includes/xml/hooks_ldap_auth.xml ./includes/devtools.php A big thanks to everyone who has contributed to this solution: kpatten, haqa, malcolmx and zemic. |
#131
|
|||
|
|||
Quote:
Code:
Fatal error: Call to undefined function ldap_connect() in D:\www\vhosts\localhost\includes\functions.php(7038) : eval()'d code on line 36 |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|