Zend_Auth_Adapter_Ldap “Adapter options array not in array”

Whilst trying to setup LDAP authentication for the first time in Zend Framework, I can across this little quirk when passing parameters to Zend_Auth_Adapter_Ldap, namely that I wasn’t passing an array even though it was an array (which I checked using Zend_Debug)

Basically Zend Framework expects you to have multiple LDAP servers (even if you have alternative failover in place on a single subdomain, for example) so if you only have a single LDAP server specified in the array, it needs to be nested in an array.

$config = new Zend_Config_Ini(APPLICATION_PATH.’/configs/application.ini’, APPLICATION_ENV);
$options[] = $config->ldap->toArray();

http://forums.zend.com/viewtopic.php?f=69&t=5898

Add comment