0

So I realize you can use this function to check if the password a user entered id correct

pyad.set_defaults(ldap_server="X.X.X.X",username=username,password=password)

all I have to do is provide a username/password

then

try:
    user=pyad.aduser.ADUser.from_guid("A guid that you know works") 
except:
    print("Invalid Credentials")

But I wanted to know if there was perhaps a better way to do this. It seems like PYAD isn't really meant for this.

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
  • I think you'd be better off using LDAP or Kerberos for user authentication. `pyad` seems to be more for administrative actions. Try `ldap3` or `python-ldap`. – Jonathon Reinhart May 31 '21 at 16:49
  • Here's some code I've written that may be a useful reference for you: [Adman](https://gitlab.com/JonathonReinhart/adman), [Diress](https://gitlab.com/JonathonReinhart/diress). – Jonathon Reinhart May 31 '21 at 16:53

0 Answers0