顯示具有 ldap 標籤的文章。 顯示所有文章
顯示具有 ldap 標籤的文章。 顯示所有文章

2014年7月16日 星期三

ldap.OPERATIONS_ERROR: {'info': '000004DC: LdapErr: DSID-0C090724, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v23f0', 'desc': 'Operations error'}

ldap.OPERATIONS_ERROR: {'info': '000004DC: LdapErr: DSID-0C090724, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v23f0', 'desc': 'Operations error'}

 
import ldap
connect = ldap.open('127.0.0.1')
connect.set_option(ldap.OPT_REFERRALS, 0)connect.bind_s(USERNAME, PASSWORD)
result = connect.search_s(BASE_DN, ldap.SCOPE_SUBTREE, SEARCH_FILTER)
print result


References :
active directory - Python-ldap not able to bind successfully - Stack Overflow

2014年7月6日 星期日

Python install ldap module

Modules/errors.h:8: fatal error: lber.h: No such file or directory
# apt-get install libldap2-dev


# pip install python-ldap





References :
module - Python: can't install python-ldap - Stack Overflow

2014年6月24日 星期二

OpenLDAP replication

slurpd - 獨立的程式,監控 master ldap 的更動並記錄在 log,然後對 slave 做相同動作 (新版本 slapd 已不包含 slurpd)
 
syncrepl - 介於 ldap 核心與資料庫中間,當對 master 資料庫寫入資料時,同時寫入到 slave

2014年6月23日 星期一

Python LDAP authentication





References :
Emmerling's Mind: LDAP Login Authentication Using Python LDAP
python-ldap sample code

OpenLDAP in Docker

OpenLDAP :

https://github.com/nickstenning/docker-slapd
# docker run \
-e LDAP_DOMAIN=example.com \
-e LDAP_ROOTPASS=admin \
-d slapd
Login DN:
cn=admin,dc=example,dc=com
Password:
admin

phpLDAPadmin :

https://github.com/osixia/docker-phpLDAPadmin

# docker run -p 80:80 \
-e LDAP_HOST=192.168.1.254 \
-e LDAP_LOGIN_DN=dc=example,dc=com \
-e LDAP_LOGIN_DN=cn=admin,dc=example,dc=com \
-d phpldapadmin

使用 phpLDAPadmin 匯入 ldif
https://raw.githubusercontent.com/projecthydra-labs/hydra-ldap/master/hydra-ldap-example.ldif

fatal error: sasl.h: No such file or directory.

# apt-get install libsasl2-dev