Is there a way to connect the active directory to a python website? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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.

2nd Oct 2019, 8:56 AM
ariamossar
ariamossar - avatar
1 Answer
+ 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.
4th Dec 2019, 6:46 PM
Josh Greig
Josh Greig - avatar