SQL集成使用的用户名计算机名称,而不是安全性 [英] SQL integrated security using computer name instead of user name

查看:128
本文介绍了SQL集成使用的用户名计算机名称,而不是安全性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想一个SQL防爆preSS例如在同一网络上,与我的域用户进行身份验证。它的工作原理只是罚款与Windows身份验证在SSMS中。我证实,我可以使用mydb数据库,包括编辑表格。

I am trying to an SQL Express instance on the same network, authenticating with my domain user. It works just fine with Windows Authentication in SSMS. I verified that I can use the MyDB database, including editing tables.

然而,当我尝试下面的连接字符串:

However, when I try the following connection string:

服务器= ip地址\ SQLEx preSS;数据库=的MyDB;集成安全性= SSPI;

我回来了一个错误:

无法登录所请求的开放mydb数据库。登录失败。 用户登录失败罗马尼亚\ MONSTER2 $

Cannot open database "MyDB" requested by the login. The login failed. Login failed for user 'ROMANIA\MONSTER2$'

问题是,MONSTER2是我的电脑的名称,而不是我的用户名。 (罗马尼亚域)。我在做什么错了?

The problem is that MONSTER2 is the name of my computer, not my username. (ROMANIA is the domain.) What am I doing wrong?

我忘了的东西,可能是相关的。我试图打开从我的计算机上运行的Web服务连接

I forgot something that might be relevant: I am trying to open the connection from a webservice running on my computer.

推荐答案

Web服务是根据 NT AUTHORITY \ Network服务安全上下文中运行。这将导致进程的域中访问网络资源:当使用主机的计算机帐户。

Your web service is running under the NT AUTHORITY\Network Service security context. This will cause the process to use the host's machine account when accessing network resources in the domain.

您将必须配置Web服务与您的域名标识运行。

You'll have to configure the web service to run with your domain identity.

如果您是托管Web服务在IIS中,您可以通过的模拟。这里有一个例子:

If you're hosting your web service in IIS, you can do this through impersonation. Here's an example:

<configuration>
    <system.web>
        <identity
            impersonate="true"
            userName="ROMANIA\username" 
            password="********" />
    </system.web>
</configuration>

这篇关于SQL集成使用的用户名计算机名称,而不是安全性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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