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 |
#102
|
|||
|
|||
Quote:
You will have to manually update the email address for each account, I'm afraid... H. |
#103
|
|||
|
|||
Hi guyz,
Any chance of getting this to work in vb4? |
#104
|
|||
|
|||
Ok so I am the first to report it works in vb4pl1.
Only problem is Quote:
Quote:
Nice work and congrats. |
#105
|
|||
|
|||
Hi Ho, this is Chris.
I am also implementing this in VBB4 right now ..... let's get dirty UPDATE: Ldap_Auth is woring now BUT: If a user is NOT in the LDAP it will not get generated Is there a way to generate Users in LDAP from Existing Account data in VBB? We want LDAP for Moodle and OTRS Integration SingleSignOn - so we need all Usernames with PWDs in LDAP. ( I wanted to export the UserPasswords direct via batch in LDIF BUT the salting prevents me from doing so ... ) Please give me a hint on the right direction, Chris |
#106
|
|||
|
|||
Quote:
YMMV... Many thanks to all who have taken this and made such progress including getting it to work on 4.0, I'd expected that not to be possible... Well done all! H. |
#107
|
|||
|
|||
Installed as directed and worked first try without modification. Authenticating against server 2003 AD.
|
#108
|
|||
|
|||
We're finding that the 'remember me' tick box is not working. The cookie is not being set correctly so that when the user comes back they have to re-enter their login each time.
Is anybody else gettings this? Currently working on a fix... |
#109
|
|||
|
|||
Quote:
You need to use the new-style object call to escape the chars, don't use the php external function(s) (particularly because people may be using mysqli and so forth) Replace all instances of "mysql_real_escape_string()" with: $vbulletin->db->escape_string(htmlspecialchars_uni( This is how functions_login.php makes the call, so should you... |
#110
|
|||
|
|||
Quote:
The problem was that after the user is saved with "$newuser->save()" the cookie salt is changed and the password rehashed in the database. The cookie then doesnt match it. Fix is to simply recreate the cookie by getting and rehashing the db password. Have also implemented jaikumarm's fix for the first time login issue here. Code:
if ($newuser->errors) { process_logout(); eval(standard_error("Error creating/updating user<br/>".$newuser->errors)); } else { $newuserid = $newuser->save(); // Saving the user (above) rehashes the password on the DB so now need to update cookie password also, or 'remember me' login optoin will fail. $dbuserinfo = $vbulletin->db->query_first_slave("SELECT password FROM vbull.user WHERE username = '$username'"); if ($dbuserinfo) { $db_hashed_pwd = $dbuserinfo['password']; $cookie_hashed_pwd = md5($db_hashed_pwd.COOKIE_SALT); vbsetcookie('password', $cookie_hashed_pwd); } // Following code is necessary to fix a hook timing issue with this plugin that results in users being told their login credentials are wrong the first time they login with LDAP credentials verify_authentication($username, $passwd, $vbulletin->GPC['vb_login_md5password'], $vbulletin->GPC['vb_login_md5password_utf'], $vbulletin->GPC['cookieuser'], true); exec_unstrike_user($username); process_new_login($vbulletin->GPC['logintype'], $vbulletin->GPC['cookieuser'], $vbulletin->GPC['cssprefs']); do_login_redirect(); } } $username = $vbulletin->GPC['vb_login_username']; $passwd = $vbulletin->GPC['vb_login_password']; And I removed the following line (118) which doesnt seem to do anything useful: $vbulletin->GPC['cookieuser'] = $vbulletin->GPC['vb_login_username']; |
#111
|
|||
|
|||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|