2016-06-27 75 views
2

flask_ldap3_loginを使用してActive DirectoryでFlaskアプリケーションを認証しようとしています。私は、Active Directoryとの接続を確認するために、コードを書かれている:私は私のLDAPの資格情報を提供する場合は、エラーがスローされますflask_ldap3_loginを使用したLDAPによるFlask認証

from flask_ldap3_login import LDAP3LoginManager 

config = dict() 

config['LDAP_HOST'] = 'my_ldap_host' 
config['LDAP_BASE_DN'] = 'dc=internal,dc=com' 
config['LDAP_USER_DN'] = 'ou=users' 
config['LDAP_GROUP_DN'] = 'ou=groups' 
config['LDAP_USER_RDN_ATTR'] = 'cn' 
config['LDAP_USER_LOGIN_ATTR'] = 'dn' 
config['LDAP_BIND_USER_DN'] = None 
config['LDAP_BIND_USER_PASSWORD'] = None 


ldap_manager = LDAP3LoginManager() 
ldap_manager.init_config(config) 


response = ldap_manager.authenticate('username', 'password') 
print response.status 

raise LDAPOperationResult(result=result['result'], description=result['description'], dn=result['dn'], message=result['message'], response_type=result['type']) 
ldap3.core.exceptions.LDAPOperationsErrorResult: LDAPOperationsErrorResult - 1 - operationsError - None - 000004DC: LdapErr: DSID-0C0906E8, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db1 - searchResDone - None 

誰かが私にフラスコアプリケーションを認証するための適切な方法を教えてもらえますLDAPとは?

+0

私は同じ問題に直面しています。 – Gianluca

答えて

0

あなたのLDAPにアクセスするためのログイン名とパスワードを提供する必要があります。

app.config['LDAP_BIND_USER_DN'] = 'CN=someUser,CN=Users,DC=domain,DC=local' 
app.config['LDAP_BIND_USER_PASSWORD'] = "secretpw" 
関連する問題