MantisBT - CDash
View Issue Details
0009706CDashpublic2009-10-13 02:112010-02-21 12:32
Solomon Matthews 
Julien Jomier 
normalfeaturealways
closedfixed 
1.4 
1.5 
0009706: Non-anonymous LDAP authentication (e.g. for Active Directory) - feature request and example implementation
Some directories (e.g. AD) require an authenticated bind to be performed.

My organization requires authentication against AD, to test the feasibility I have implemented the feature in place - see "Additional Information" for the test implementation. The base version is CDash 1.4.2.

The implementation adds control over LDAP_OPT_REFERRALS - this needs to be false for AD 2003 and AD2008.
Modifications to login.php:

--- login.php.orig 2009-10-13 12:39:06.000000000 +1100
+++ login.php 2009-10-13 16:42:59.000000000 +1100
@@ -88,6 +88,12 @@

   $ldap = ldap_connect($CDASH_LDAP_HOSTNAME);
   ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION,$CDASH_LDAP_PROTOCOL_VERSION);
+ ldap_set_option($ldap, LDAP_OPT_REFERRALS,$CDASH_LDAP_OPT_REFERRALS);
+ // Bind as the LDAP user if authenticated ldap is enabled
+ if($CDASH_LDAP_AUTHENTICATED)
+ {
+ ldap_bind($ldap, $CDASH_LDAP_BIND_DN, $CDASH_LDAP_BIND_PASSWORD);
+ }
   if(isset($ldap) && $ldap != '')
     {
     /* search for pid dn */

=

Modifications to config.php:

--- cdash/config.php.orig 2009-10-13 17:06:25.000000000 +1100
+++ cdash/config.php 2009-10-13 16:40:26.000000000 +1100
@@ -63,6 +63,11 @@
 $CDASH_LDAP_HOSTNAME='localhost';
 $CDASH_LDAP_BASEDN='ou=people,dc=organization,dc=com';
 $CDASH_LDAP_PROTOCOL_VERSION='3';
+# For authentication against AD, set CDASH_LDAP_AUTHENTICATED to '1' CDASH_LDAP_OPT_REFERRALS to '0', and specify a bind DN and password
+$CDASH_LDAP_OPT_REFERRALS='1';
+$CDASH_LDAP_AUTHENTICATED='0';
+$CDASH_LDAP_BIND_DN='cn=user,ou=people,dc=orgranization,dc=com';
+$CDASH_LDAP_BIND_PASSWORD='password';

 // Set to start the autoremoval on the first build of the day
 $CDASH_AUTOREMOVE_BUILDS='0';
No tags attached.
Issue History
2009-10-13 02:11Solomon MatthewsNew Issue
2009-10-22 03:07Julien JomierStatusnew => assigned
2009-10-22 03:07Julien JomierAssigned To => Julien Jomier
2009-10-22 03:08Julien JomierNote Added: 0018164
2009-10-22 03:08Julien JomierStatusassigned => resolved
2009-10-22 03:08Julien JomierFixed in Version => 1.5
2009-10-22 03:08Julien JomierResolutionopen => fixed
2010-02-21 12:32Julien JomierStatusresolved => closed

Notes
(0018164)
Julien Jomier   
2009-10-22 03:08   
Added to version 1.5, to be in the official release 1.6. Thanks for providing the fix.