# OpenLDAP bind through python-ldap fails

## DeIM

Hi, 

have this config:

```
olcAccess: {0}to *  by anonymous auth

olcAccess: {1}to *  by dn.base="loginName=admin,dc=server,dc=com" manage

olcAccess: {2}to dn.subtree="ou=people,dc=server,dc=com" by dn.children="ou=g0,ou=section,dc=server,dc=com" manage

olcAccess: {3}to dn.subtree="ou=section,dc=server,dc=com" by dn.children="ou=g0,ou=section,dc=server,dc=com" manage
```

but I can't bind:

```
4fa0201f conn=1005 fd=16 ACCEPT from IP=127.0.0.1:34714 (IP=127.0.0.1:389)

4fa0201f conn=1005 op=0 BIND dn="uid=0,ou=g0,ou=section,dc=server,dc=com" method=128

4fa0201f conn=1005 op=0 RESULT tag=97 err=49 text=

4fa0201f conn=1005 op=1 UNBIND

4fa0201f conn=1005 fd=16 closed
```

I'm trying to bind by:

```
  l = ldap.initialize("ldap://localhost/")

  l.protocol_version = ldap.VERSION3

  l.simple_bind_s('uid=0,ou=g0,ou=section,dc=server,dc=com','pass')
```

On pass tried {MD5} and {SSHA} equivalents also.

uid=0,ou=g0,ou=section,dc=server,dc=com is alias of uid=0,ou=people,dc=server,dc=com

python-ldap 2.3.13

openldap 2.4.30

Thank you for any help  :Wink: 

----------

## RazielFMX

LDAP Error code 49 is invalid credentials.  If you have anonymous bind, why are you passing creds?  Also, is "0" a valid user id?  Normally, uid fields in ldap are string user names, such as deim.

----------

## DeIM

I just wanna bind to user of uid "0" or with my loginName, no anonymous login.

I'd like to bind to one account in admin group of aliases in g0. Have g1...n for common privileges, but search there is performed only by the bound account mentioned before.

Maybe usage of loginName instead of uid will make the magic.

You say uid is usually login name string - it equals loginName and uid is a number in "my world".

It may be wrong but i understand ldap this way  :Wink: 

Thank you.

----------

## DeIM

Strange - it seems I can't bind to alias. Am I correct?

----------

