zoukankan      html  css  js  c++  java
  • Python实现AD域认证

    Python 通过ldap进行ad域账号的校验。

    首先需要安装python-ldap的模块 http://www.python-ldap.org/。 在这里用的是windows系统,当然比较容易,下载地址 http://pypi.python.org/pypi/python-ldap/。

    安装后在python 的交互环境里输入import ldap 如果没有问题就说明安装成功了。

    Windows 无法安装 python-ldap 时,详见:https://xiexianbin.cn/python/2018/04/23/pip-install-python-ldap

     python-ldap   3行集成域认证

    import ldap
    conn = ldap.initialize('ldap://host')
    conn.simple_bind_s('domainusername', 'password')

    注意验证时传空值验证也是可以通过的,注意要对password进行检查。

    ldap3

    from ldap3 import Server,Connection,ALL,NTLM
    server = Server('192.168.10.1',get_info=ALL)
    conn = Connection(server,user='Domain\user', password='xxxxxxx',auto_bind=True,authentication='NTLM')

     Apache Directory Studio连接Windows AD域控制器

    http://www.what21.com/sys/view/ldap_ldap-summary_1473141912625.html

    参考链接:

    https://blog.csdn.net/shanliangliuxing/article/details/7710925

    传空值验证也是可以通过的

    https://www.cnblogs.com/linxiyue/p/10250243.html  

    Python-LDAP增删改查

    https://blog.csdn.net/shanliangliuxing/article/details/8266267

    Python使用LDAP做用户认证

    https://www.cnblogs.com/linxiyue/p/10250243.html

  • 相关阅读:
    git初学【常用命令、上传项目到码云或从码云拉取、克隆项目】
    dedecms自学
    sublime3使用笔记
    路由功能
    bootstrap模态框篇【遇到的问题】
    justgage.js的使用
    fullpage.js使用方法
    js&jq遇到的问题(不断更新中)
    图灵完备——停机问题
    中断
  • 原文地址:https://www.cnblogs.com/xiaozi/p/10370572.html
Copyright © 2011-2022 走看看