连接字符串使用域用户? [英] Connection String Using a Domain User?

查看:464
本文介绍了连接字符串使用域用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

previously为我们所有的asp.net应用中,我们一直在使用SQL Server中的系统管理员用户连接并添加/更新/删除/获取数据。我们的SQL管理员希望删除该帐户,并创建一个域帐户,所以我们可以用我们的.NET应用程序中的帐户。

Previously for all our asp.net applications we have been using a sysadmin user within SQL Server to connect and add/update/delete/get data. Our SQL Admin wants to delete that account and create a Domain Account so we can use that account within our .net applications.

我的当前连接字符串是:

My current connection string is:

 
name="name" connectionString="Data Source=server;Initial Catalog=database;Persist Security Info=True;User ID=user;Password=password" providerName="System.Data.SqlClient"

将连接字符串是什么使用域帐户?

What would the connection string be for using a domain account?

我试过:


name="name" connectionString="Data Source=server;Initial Catalog=database;Persist Security Info=True;User ID=domain\user;Password=password" providerName="System.Data.SqlClient"

和它不工作。

有不同的方式使用域帐户连接到SQL Server?

Is there a different way to connect to SQL Server using a domain account?

感谢您的帮助。

推荐答案

看一看 connectionstrings.com 为每一个可能的变化 - 我用所有的时间一个非常方便的资源

Have a look at connectionstrings.com for every possible variation - a very handy resource I use all the time

具体而言,您希望格式为:

Specifically, you want this format:

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

这,当然只是如果有问题的域帐户是一个开放的连接工作。

This, of course, only works if the domain account in question is the one opening the connection.

有没有简单的方法来任意凭据连接 - 但你可以冒充用户有问题然后连接。

There's no easy way to connect with arbitrary credentials - but you can impersonate the user in question and then connect.

这可以是一个有点痛。如果用户是在本地网络上的另一种方法是在网站上使用Kerberos身份验证。该页面将与相关用户的权限送达 - 那么你可以使用连接字符串上方,IIS将连接到数据库与每个用户的相应凭证

This can be a bit of a pain. An alternative if the users are on the local network is to use Kerberos authentication on your site. The pages will be served with the relevant user's permissions - then you can use the connection string above and IIS will connect to the Db with the appropriate credentials for each user.

这篇关于连接字符串使用域用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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