[英]How can I send an ODBC connection string to an SQL server if the user is authenticated by Active Directory?
Technologies:SQL Server 2008, .NET 2008, Active Directory技术:SQL 服务器 2008、.NET 2008、Active Directory
I'm trying to send a connection string via my application to the SQL Server to authenticate a username and password that is stored in Active Directory, not locally on the db server.我正在尝试通过我的应用程序将连接字符串发送到 SQL 服务器,以验证存储在 Active Directory 中的用户名和密码,而不是本地存储在数据库服务器上。
Unfortunately, this isn't working because when I send the connection string, it only checks the SQL server local users, instead of checking the credentials against active directory.不幸的是,这不起作用,因为当我发送连接字符串时,它只检查 SQL 服务器本地用户,而不是检查活动目录的凭据。 Does anyone know of a solution?有谁知道解决方案?
Currently using ODBC to make the connection.目前使用 ODBC 进行连接。
You cannot make a connection to SQL Server in this way.您无法以这种方式连接到 SQL 服务器。 SQL Server supports only two kinds of connections: SQL 服务器只支持两种连接方式:
SQL Login, where to connect, you supply it with the username and password of a SQL Login (ie, not a Windows/AD Logon) defined on that SQL Server. SQL 登录,在哪里连接,您提供SQL 登录(即,不是Windows/AD 登录)的用户名和密码在该 Z9778840A0100CB30C982876741B0B 上定义。 or,或者,
A Trusted Connection, where to connect, you supply it with NO username or password and it connects you to a session based on your current Windows session's security context (assuming you are so authorized).一个受信任的连接,在哪里连接,您不提供用户名或密码,它会根据您当前的Windows会话的安全上下文将您连接到 session(假设您已获得如此授权)。
Those are your only choices.这些是你唯一的选择。 If you want to connect to SQL Server as a different Windows/AD security context, you will have to create a Windows session with that context first.如果要连接到 SQL 服务器作为不同的 Windows/AD 安全上下文,则必须首先使用该上下文创建Windows session。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.