+ 4
Is there a way to connect the active directory to a python website?
I would like to connect the active directory to my website and use the active directory as login, so whatever the user's username and password to their PC, it will also be the same to the website.
1 Resposta
+ 1
Yes.
There are many Python frameworks and I would look for a way that best matches your Python web framework or library. Authentication and session management are common problems to most websites so web frameworks tend to have their own unique implementations.
For Flask:
https://stackoverflow.com/questions/41684463/flask-active-directory-authentication
For django:
https://django-auth-ldap.readthedocs.io/en/latest/
For tornado, I would install python-ldap like this: https://www.python-ldap.org/en/latest/installing.html and make some API's to handle the login, logout... Possibly make a session_cookie table to store session information while logged in. I used tornado extensively and, unlike most web frameworks, tornado doesn't appear to have an opinion about authentication or session management so you just do it however you want.