Windows 身份验证登录问题

发布于 2024-07-20 14:34:20 字数 992 浏览 3 评论 0原文

重复:Windows 身份验证可信连接不起作用

我记录了在 Windows Server(机器 1)中为“abc\user1”。 Windows Server 计算机位于 abc 域中。 MSSQL Server 位于计算机 1 上的“abc”域中,并且具有混合模式和身份验证。 它有帐户“abc\user1”和“abc\user2”。 两者都具有 sysadmin 和 serveradmin 角色。

我使用“abc\user2”登录另一台机器(机器 2)。 相同的域。 运行连接到 MSSQL Server 的 ant。 URL 的构成如下。

jdbc:sqlserver://%DB_IP%:%DB_PORT%;SelectMethod=cursor;integratedSecurity=true;DatabaseName=dbname;

1) 在机器 2 上,如果我使用“abc\user2”凭据进行连接,那么它工作正常。 因为集成安全= true。

2)从机器2,如果我使用“abc\user1”凭据进行连接,那么它就不行,因为integratedSecurity=true并采用系统凭据,即“abc\user2”。 即使我设置integratedSecurity=false,那么它也不会使用“abc\user1”进行连接

我对URL进行了哪些更改才能从Machine2连接到“abc\user1”。 url 中要添加哪些属性? 或者 驱动程序不支持使用其他域\用户凭据?

MSSQL Server 需要设置什么?

迪帕克

Duplicate of: Windows authentication trusted connection not working

I logged in the Windows Server(Machine 1) as "abc\user1 ". Windows Server machine is in abc domain.
MSSQL Server is in the "abc" domain on Machine 1 and have mixed mode.authentication. It has account "abc\user1 " and "abc\user2 ". Both has role of sysadmin and serveradmin.

I logged in another machine(Machine 2) using "abc\user2 ". Same Domain. Run the ant which connect to MSSQL Server. URL is formed as follows.

jdbc:sqlserver://%DB_IP%:%DB_PORT%;SelectMethod=cursor;integratedSecurity=true;DatabaseName=dbname;

1) From Machine 2, If I use "abc\user2" credential for connection, then it works fine. since integratedSecurity=true.

2) From Machine 2, If I use "abc\user1" credential for connection, then it doesn't fine, since integratedSecurity=true and take System Credentials i.e "abc\user2".
Even if I make integratedSecurity=false , then also it doesn't connect using "abc\user1"

What changes to URL I have make to work for "abc\user1" from Machine2 for connection. what properties to be added in url?
OR
Driver doesn't support to use another domain\User Credentials?

What need to set on MSSQL Server ??

Deepak

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

最初的梦 2024-07-27 14:34:20

当您使用integratedSecurity=true时,您不必指定任何凭据,当前登录系统的用户将用于针对 SQLserver 进行身份验证。

如果integratedSecurity=false。 那么你必须在 connString 中指定 Sql 服务器凭据(用户和密码)

When you use integratedSecurity=true you don't have to specify any credentials, the user currently logged in the system will be used to authenticate against SQLserver.

If integratedSecurity=false. then you have to specify Sql server credentials(user and password) in the connString

凯凯我们等你回来 2024-07-27 14:34:20

我认为 Deepak 基本上想做的是:

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;User ID=myDomain\myUsername;Password=myPassword;

但是,这只适用于 CE 设备。

在普通机器上,它会点击集成部分并使用当前凭据。

我认为他想指定要使用的域用户,而不是当前登录的用户。

I think what Deepak wants to basically do is this:

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;User ID=myDomain\myUsername;Password=myPassword;

However, that only works on CE devices.

On normal machines, it hits the Integrated part and uses the current credentials.

I think he wants to specify the domain user to use, instead of the currently logged in one.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文