具有Windows身份验证的cx_Oracle [英] cx_Oracle with Windows authentication

查看:81
本文介绍了具有Windows身份验证的cx_Oracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使cx_Oracle与Windows OS身份验证一起使用,但失败了:

  1. 我知道使用pyodbc可以使用trusted_connection='yes'使其工作,但是我必须使用Oracle客户端(11g/12c),它似乎与pyodbc配合并不好. p>

  2. 最接近我需要的似乎是使用 cx_Oracle 5.2.1中提到了外部身份验证发行说明,但这似乎也与钱包有关.

我希望外面有一个聪明的人可以向我指出正确的方向,谢谢:)

解决方案

对于使用cx_Oracle进行外部身份验证,使用的代码非常简单:

import cx_Oracle

conn = cx_Oracle.connect(dsn = "the_tns_entry_name")

I would like to make cx_Oracle work with Windows OS authentication but fail miserably:

  1. I know that with pyodbc you can make it work using trusted_connection='yes' but I have to make use of the Oracle client (11g/12c), which does not seem to go well in hand with pyodbc.

  2. The closest to what I need seems to be the use of Wallets. However, duplicating existing information does not seem like the way to go.

  3. There is mention of external authentication in the cx_Oracle 5.2.1 release notes but this also seems related to wallets.

I hope that some clever person out there can point me in the right direction, thanks :)

解决方案

For external authentication with cx_Oracle, the code to use is as simple as this:

import cx_Oracle

conn = cx_Oracle.connect(dsn = "the_tns_entry_name")

这篇关于具有Windows身份验证的cx_Oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆