一个简单的active directory用户授权工具。
pyad_auth的Python项目详细描述
Pyad_认证
简单的python库,用于根据active directory验证用户的凭据
要求
- python>;=2
- LDAP3
安装
- pip install pyad_auth
用法
在项目中包含pyad_auth
使用pyad_auth.connect()连接到服务器:
try: server = pyad_auth.connect("myip", port) except Exception as e: # handle exception
使用pyad_auth.auth()验证用户是否在活动目录中:
try: authenticated = pyad_auth.auth(server, "username", "password") except Exception as e: # handle exception