Open duiniwukenaihe opened 1 year ago
数据库插入ldap信息后,再次验证时,没有搜到到这个记录,通常是因为有中文或者其他的情况,没有纠结过这个问题。
你可以: yum install openldap-clients ldapsearch -x -H ldap://127.0.0.1:389 -b "dc=baidu,dc=com" -D "cn=admin,dc=baidu,dc=com" -w baidu 看看自己有哪些字段能用,使用唯一的字段 比如 sAMAccountName https://stackoverflow.com/questions/508014/active-directory-ldap-query-by-samaccountname-and-domain
参考: https://github.com/hhyo/Archery/issues/1533 https://github.com/hhyo/Archery/issues/1184
v1.11用的英文字段也不行,第二次登录报错,map全是英文和数字。 ![Uploading image.png…]()
重现步骤
settings.py 如下: 修改 username: uid: AUTH_LDAP_USER_ATTR_MAP=( dict, {"username": "uid", "display": "displayname", "email": "mail"}, ), LDAP配置如下: ENABLE_LDAP = True if ENABLE_LDAP: import ldap from django_auth_ldap.config import LDAPSearch
重启服务,可以正常登陆ldap用户test01:
管理员用户控制台,用户名格式为01 test: 退出普通用户,重新登陆:
预期外的结果
能正常匹配uid字段 ,体验了jumpserver yearning,jenkins等与freeipa集成都可以正常使用,yearning为例:
日志文本
版本
1.9.1
部署方式
Docker
是否还有其他可以辅助定位问题的信息?比如数据库版本等
No response