I am trying to take login input and pass to our AD server to authenticate a user. I keep getting an error : invalidCredentials, but I have verified the credentials a number of times. Am I using the variables correctly? Any feedback is appreciated. I currently have the following code.
`@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)`
And I am getting the following error:
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'}