0

我已经在我的网络服务器中安装了 python ldap

(venv) vocstartsoft:~/environment/myproject $ pip install python-ldap
Requirement already satisfied: python-ldap in ./venv/lib/python3.6/dist-packages (3.3.1)
Requirement already satisfied: pyasn1-modules>=0.1.5 in ./venv/lib/python3.6/dist-packages (from python-ldap) (0.2.8)
Requirement already satisfied: pyasn1>=0.3.7 in ./venv/lib/python3.6/dist-packages (from python-ldap) (0.4.8)

我将代码添加到 config.py

import ldap
AUTH_TYPE = 2
AUTH_LDAP_SERVER="ldap://my public address:389"
AUTH_LDAP_USE_TLS=False
AUTH_LDAP_SEARCH = "dc=example,dc=com"
AUTH_LDAP_BIND_USER = "cn=admin,dc=example,dc=com"
AUTH_LDAP_BIND_PASSWORD = "123"
AUTH_LDAP_APPEND_DOMAIN ="example.com"

我将 phpmyadmin 用于 openldap:

  • 登录DN:cn=a​​dmin,dc=example,dc=com
  • 密码:123

比我登录我的网页:登录无效。请再试一次。

  • 用户:管理员
  • 密码:123
4

0 回答 0