繁体   English   中英

烧瓶登录和LDAP身份验证

[英]Flask-login and LDAP authentification

我无法连接到以下LDAP测试服务器。 每个输入或建议,表示赞赏。

LDAP服务器信息

Server: ldap.forumsys.com  
Port: 389

Bind DN: cn=read-only-admin,dc=example,dc=com
Bind Password: password

所有用户密码均为password

individual Users (uid) and Group (ou) 

ou=mathematicians,dc=example,dc=com
riemann
gauss
euler
euclid

烧瓶

@app.route('/')
def index():
    l = ldap.open("ldap.forumsys.com", port=389)
    username = "uid=einstein,ou=scientists,dc=example,dc=com"
    password = "password"
    try:
      l.protocol_version = ldap.VERSION3
      l.simple_bind_s(username, password)
      return "hi"

    except Exception, error:
      return "no"

我也遇到了同样的问题,下面通过修复此问题:

使用l.simple_bind(用户名,密码)代替l.simple_bind_s(用户名,密码)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM