我正在尝试获取登录输入并传递给我们的 AD 服务器以验证用户身份。我不断收到错误消息:invalidCredentials,但我已多次验证凭据。我是否正确使用了变量?任何反馈表示赞赏。我目前有以下代码。
`@app.route('/login', methods=['GET','POST'])
def login():
username = request.form['username']
password = request.form['password']
server = Server('dc.ourcompany.com', use_ssl=True, get_info=ALL)
conn = Connection(server, user='%s' %username, password='%s' %password, raise_exceptions=False)
conn.open()
conn.bind()
if not conn.bind():
print('error in bind', conn.result)`
我收到以下错误:
error in bind {'dn': '', 'message': '80090308: LdapErr: DSID-0C0903A8, comment: AcceptSecurityContext error, data 52e, v1db1\x00', 'result': 49, 'referrals': None, 'saslCreds': None, 'type': 'bindResponse', 'description': 'invalidCredentials'}