0

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'}
AlliDeacon
  • 1,365
  • 3
  • 21
  • 35

1 Answers1

3

I added in NTLM authentication, and that seemed to have resolved the issue.

AlliDeacon
  • 1,365
  • 3
  • 21
  • 35