Windows身份验证信任连接不工作 [英] Windows authentication trusted connection not working

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

问题描述

MSSQL服务器在abc域中并具有混合模式身份验证。
我从不在域或域xyz的机器连接,但在同一网络使用MSSQL Jdbc驱动程序2.0。我已以xyz域名中的管理员或帐户登录。

MSSQL Server is in the "abc" domain and have mixed mode authentication. I am connecting from the machine which is not in domain or in a domain "xyz" but with in the same network using MSSQL Jdbc driver 2.0. I have logged in as admin or account in xyz domain.

使用以下网址连接sa或SQL模式身份验证即可正常工作。

It works fine using following url for connection for "sa" or SQL Mode Authentication.


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

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

它不工作对于使用凭证MSSQLDomain\username即窗口认证abc\ username,使用以下url

It doesn't work For window authentication using credential "MSSQLDomain\username" i.e "abc\username", using following url


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

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

出现以下错误。
用户的登录失败。

Gives following error. Login failed for user ''. The user is not associated with a trusted SQL Server connection.

我已经尝试为url添加属性Trusted_Connection = Yes,但仍然给出相同的错误。
我不想映射SQL Server的驱动器。我可以通过提供MSSQLDomain \username和密码访问SQL Server计算机的任何共享文件夹。

I have tried adding property Trusted_Connection=Yes to url, but still gives same error. I don't want to map the drive of the SQL Server. I am able to access the any shared folder of the SQL Server Machine by providing "MSSQLDomain\username" and password.

它适用于两种身份验证模式,如果两者机器在同一个域。
如果我使用的jtDS驱动程序不在域或在xyz域在同一个网络即同一子网内的机器,它工作正常。

It works fine for both authentication mode, if both machine is in same domain. If I am using jtDS Driver from the machine which is not in domain or in "xyz" domain within same network i.e same subnet, it works fine.

推荐答案

这是Windows身份验证的故意和正确的行为。

This is the deliberate and correct behaviour of Windows Authentication.

这是因为您从中连接的域不是与您的SQL Server实例所在的Windows域相同。

It is because the Domain from which you are connecting from, is not the same Windows Domain as the one where your SQL Server instance resides.

我相信有一些方法可以桥接域名,但是它们需要自定义和棘手的实现。您还必须在域之间配置信任关系。

I believe there are methods for bridging the Domains so to speak, however they require custom and tricky implementation. You also will have to configure a trust relationship between the domains.

以下主题包含您可能会发现有用的讨论。

The following thread contains discussions which you will likely find useful.

http:// sql-server-performance .com / Community / forums / p / 24601 / 137574.aspx

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

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