On Fri, Nov 27, 2009 at 4:57 PM, Eric Helgeson <[email protected]> wrote:
> Try adding some common_log statements in the plugin to see if the code is
> actually reached.
Still trying...
It seems that the host definition as an element in an array in
config.php doesn't get set properly in the function
onInitializePlugin()
I see that the value of the key 'host' gets set to 'Array' in the
function ldap_get_config()
So I changed my config.php defintion
#'host'=>array('ldap.company.com'),
'host'=>'ldap.company.com',
Now that seems to be getting set correctly. But still no go..
LdapAuthenticationPlugin.php
//cannot use Net_LDAP2::connect() as StatusNet uses
//PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handleError');
//PEAR handling can be overridden on instance objects, so we do that.
$ldap = new Net_LDAP2(isset($config)?$config:$this->ldap_get_config());
$ldap->setErrorHandling(PEAR_ERROR_RETURN);
common_log(LOG_INFO, 'ldap log3');
$err=$ldap->bind();
common_log(LOG_INFO, 'ldap log4');
log4 message doesn't get written so I guest the problem happens with bind().
I installed LDAP2 with 'pear install Net_LDAP2' and everything seems
to be in it's place in /usr/share/php/
Looking at the Net_LDAP2 documentation the defaults plus the host and
basedn should be enough.
Any pointers to how I should go from here on in?
Chris.
>
> -- Sent from my Palm Pre
> ________________________________
> Chris Fanning wrote:
>
> On Fri, Nov 27, 2009 at 4:43 PM, Eric Helgeson <[email protected]>
> wrote:
>> Just to be sure you are changing the examples in the config to yours
>> right?
>
> yes, these examples are correct in my config
>> 'basedn'=>'ou=people,dc=company,dc=com',
>> 'host'=>array('ldap.company.com'),
>
> But even if they weren't I would expect the statusnet server to try
> and open an ldap connection with what ever host was defined as long as
> the name is resolved, right? I don't even see statusnet server do a
> dns petition to resolve the host name.
>
> Chris.
>
>>
>> -- Sent from my Palm Pre
>> ________________________________
>> Chris Fanning wrote:
>>
>> On Fri, Nov 27, 2009 at 4:16 PM, Eric Helgeson <[email protected]>
>> wrote:
>>> You need 0.9, the event hooks are not in 0.8. Try that before anymore
>>> debugging.
>>>
>> Thank for getting back.
>> Ok. I've downloaded and done a fresh install with
>> statusnet-mainline-0.9.x.tar.gz
>>
>> my config is
>>
>> addPlugin('ldapAuthentication', array(
>> 'provider_name'=>'Example',
>> 'authoritative'=>true,
>> 'autoregistration'=>false,
>> 'basedn'=>'ou=people,dc=company,dc=com',
>> 'host'=>array('ldap.company.com'),
>> 'password_changeable'=>false,
>> 'email_changeable'=>false,
>> 'attributes'=>array(
>> 'username'=>'uid',
>> 'nickname'=>'uid',
>> 'email'=>'mail',
>> 'fullname'=>'cn')
>> ));
>>
>> And still the same result. "Incorrect username or password."
>> I see that the statusnet server does not try to open an ldap connection.
>>
>>> Also if you are connecting to ad, you need a service account to bind,
>>> anon
>>> binds are not allowed.
>> I'm using openldap.
>>
>> Chris,
>>
>>>
>>> -- Sent from my Palm Pre
>>> ________________________________
>>> Chris Fanning wrote:
>>>
>>> On Fri, Nov 27, 2009 at 12:34 PM, Chris Fanning
>>> <[email protected]> wrote:
>>>> Hi,
>>>>
>>>> I'm trying to use the ldap plugin with statusnet-0.8.2
>>>> Is that possible or do I need to go with 0.9 ?
>>>>
>>> opps. :(
>>>
>>> So I've downloaded statusnet-mainline-master.tar.gz
>>> and configured as following.
>>>
>>> addPlugin('ldapAuthentication', array(
>>> 'provider_name'=>'Example',
>>> 'authoritative'=>true,
>>> 'autoregistration'=>true,
>>> #'binddn'=>'username',
>>> #'bindpw'=>'password',
>>> 'basedn'=>'ou=people,dc=company,dc=com',
>>> 'host'=>array('ldap.company.com'),
>>> 'password_changeable'=>false,
>>> 'attributes'=>array(
>>> 'username'=>'uid',
>>> 'nickname'=>'uid',
>>> 'email'=>'mail',
>>> 'fullname'=>'cn')
>>> ));
>>>
>>> Still no go though. Not even an attempt to connect to the ldap server.
>>>
>>> Chris.
>>>
>>>
>>>> I would like to use the ldap plugin to only allow users who are
>>>> already in the ldap database and, deny user registration from
>>>> statusnet.
>>>>
>>>> I have done:
>>>> pear install Net_LDAP2 and,
>>>> extracted the plugin from
>>>> http://gitorious.org/statusnet/mainline/trees/ and pasted Ldap
>>>> directory into the plugins directory
>>>>
>>>> in config.php I have.
>>>> $config['site']['logfile'] = '/tmp/statusnet.log';
>>>> #$config['ldap']['binddn']
>>>> #$config['ldap']['bindpw']
>>>> $config['ldap']['basedn'] = 'ou=people,dc=example,dc=com';
>>>> $config['ldap']['host'] = 'ldap.example.com';
>>>>
>>>> $config['ldap']['nickname_attribute'] = 'uid';
>>>> $config['ldap']['nickname_email'] = 'mail';
>>>> $config['ldap']['nickname_fullname'] = 'cn';
>>>> #$config['ldap']['nickname_homepage']
>>>> #$config['ldap']['nickname_location']
>>>>
>>>> $config['ldap']['authoritative'] = 'false';
>>>> $config['ldap']['autoregister'] = 'false';
>>>>
>>>> addPlugin('ldap');
>>>>
>>>>
>>>> When I try to login I get "Incorrect username or password."
>>>> Looking at network traffic I see there no connection is made to the
>>>> ldap.example.com server.
>>>>
>>>> Nothing is written to the log file.
>>>> Any help please?
>>>>
>>>> Thanks.
>>>> Chris.
>>>>
>>> _______________________________________________
>>> StatusNet-dev mailing list
>>> [email protected]
>>> http://lists.status.net/mailman/listinfo/statusnet-dev
>>>
>>
>
_______________________________________________
StatusNet-dev mailing list
[email protected]
http://lists.status.net/mailman/listinfo/statusnet-dev