本文介绍了Python-ldap:是否可以在不显式写入密码的情况下进行绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
编写一个 Python 脚本,我想知道是否可以在不以明文形式写入密码的情况下绑定到 LDAP 服务器,如下例所示:
Writing a Python script, I would like to know if it is possible to bind to an LDAP server without writing the password in plaintext, like in this example:
推荐答案
解密名为.credentials"的文件的示例函数.这当然会有一个单独的脚本,在尝试使用它之前首先将凭据加密到文件中.
Example Function for decrypting a file called '.credentials'. This would of course have a seporate script to encrypt the credentials to a file in the first place prior to trying to use it.
所以你会调用这个函数:
So you would call this function:
这篇关于Python-ldap:是否可以在不显式写入密码的情况下进行绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!