使用pyhs2python连接配置单元Kerberos身份验证

2024-09-28 03:12:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用Kerberos身份验证连接到配置单元。但我收到错误“NotImplementedError:authMechanism is not supported or not implemented”

我想我需要将authMechanism设置为Kerberos。在

import pyhs2

with pyhs2.connect(host='wx0000',

                   port=10000,

                   authMechanism="Kerberos",

                   user='xxxxx',

                   password='******',) as conn:

Tags: orimport身份验证isconnect错误withnot
2条回答

从源代码来看,authMechanism是区分大小写的,所以您需要它是“KERBEROS”。在

只要运行脚本的用户具有有效的kerberos票证或密钥选项卡,此连接字符串就可以工作:

import pyhs2

with pyhs2.connect(host='beeline_hostname',
                    port=10000,
                    authMechanism="KERBEROS") as conn:

    with conn.cursor() as cur:
            print cur.getDatabases()

用户名、密码和任何其他配置参数都不会通过KDC传递。在

相关问题 更多 >

    热门问题