【问题标题】:how to pass the base64 encoded password to teradatatsql.connect() in python如何将base64编码的密码传递给python中的teradatatsql.connect()
【发布时间】:2020-07-28 13:27:09
【问题描述】:

我在使用 tearadatasql 包连接到 taradata 时使用了人类可读的密码,我能够成功连接。但是当我尝试使用相同密码(base64encoded)的 base64 编码字节而不是 readable 时,我收到一个错误“The UserId, Password or Account is invalid”,凭据

base64encoded = base64.b64encode(bytes('可读密码','utf-8')) teradatasql.connect('{"host":"server","user":"username","password":"'+base64encoded+'","logmech":"LDAP"}')

谁能知道,如何在这里传递base64编码的密码?

【问题讨论】:

  • teradatasql documentation 中没有任何内容表示支持 base64 编码。如果目标是避免在脚本中使用明文密码,则可以使用加密机制。
  • 谢谢@Fred,你说得对,我也看过文档,但没有找到。有没有其他python包,它支持base64编码的密码,同时连接到teradat
  • 我不知道。如果将 base64 值传递给脚本,您可以使用 password= 关键字将 b64decode 值传递给 teradatasql,而不是将其作为 JSON 字符串中的属性值。

标签: python-3.x teradata


【解决方案1】:

@Fred 是正确的。 Teradata SQL Driver for Python 不直接支持以 base64 编码指定的密码。

正如@Fred 所说,Teradata SQL Driver for Python 确实提供了“Stored Password Protection”功能。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-06-05
    • 2022-01-12
    • 2011-02-23
    • 2013-06-23
    • 1970-01-01
    • 1970-01-01
    • 2011-04-30
    相关资源
    最近更新 更多