[英]Flask-login and LDAP authentification
i cant't connect to the following LDAP Test Server. 我无法连接到以下LDAP测试服务器。 Every input or suggestions are appreciated.
每个输入或建议,表示赞赏。
LDAP Server Information LDAP服务器信息
Server: ldap.forumsys.com
Port: 389
Bind DN: cn=read-only-admin,dc=example,dc=com
Bind Password: password
All user passwords are password
. 所有用户密码均为
password
。
individual Users (uid) and Group (ou)
ou=mathematicians,dc=example,dc=com
riemann
gauss
euler
euclid
Flask 烧瓶
@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"
I also got the same issue, I fixed by following below: 我也遇到了同样的问题,下面通过修复此问题:
use l.simple_bind(username, password) instead of l.simple_bind_s(username, password) 使用l.simple_bind(用户名,密码)代替l.simple_bind_s(用户名,密码)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.