ldap3 icon indicating copy to clipboard operation
ldap3 copied to clipboard

InvalidCredentials, this error appears only with some users and it is confirmed that the credentials are correct

Open cdmb80 opened this issue 3 years ago • 1 comments

def Login():

if request.method=="POST":
    login = request.form
    username= login['username']
    password = login['password']
    
if not '@example.com' in username:
    u = username + '@example.com'
    
#else:
    #u=username.lower()

# AD-Server connection

server = "xxxxxxxxxxxxx"
getserverInfo = Server(server, get_info=ALL)

`` try: c=Connection(getserverInfo, user=u,password=password,auto_bind=True) except Exception as e: print(e)

cdmb80 avatar Jan 20 '22 13:01 cdmb80

this might be a result of policies in your domain. it's unclear if you're using ldaps/startTLS, and it looks like you're using simple binds rather than SASL

some users in your domain might be restricted to either only binding over TLS-secured connections. some users also might not be allowed to login via username/password over LDAP, they might be required to use Kerberos or another SASL mechanism. there can also be different restrictions based on where a login comes from

unfortunately, the domain won't always give great information about why it failed the bind. you could try checking with your AD admin about policies there

zorn96 avatar Feb 02 '22 18:02 zorn96