简体   繁体   English

IIS / ASP.NET使用未知用户连接到SQL Server

[英]IIS/ASP.NET connecting to SQL Server using unknown user

Defined a SQL Server, which only user x (in the domain) is allowed to connect to and only by using windows authentication. 定义了一个SQL Server,只允许用户x(在域中)连接到并且只能使用Windows身份验证。
I am connecting to the computer using user x successfully. 我正在使用用户x成功连接到计算机。
I am running my website from visual studio successfully. 我正在成功地从visual studio运行我的网站。
But when I am trying to access my website on IIS it fails because it is using a different user than x: 但是当我尝试在IIS上访问我的网站时,它失败了,因为它使用的是与x不同的用户:
When my ASP.NET web site is trying to connect it fails because it is using user y. 当我的ASP.NET网站尝试连接时失败,因为它正在使用用户y。
The connection string does not specify a user and password it uses windows authentication. 连接字符串未指定使用Windows身份验证的用户和密码。
where did user y came from? 用户y来自哪里? is it the user that IIS was installed with or log on with? 是安装IIS还是登录的用户?

The SQL Server is not mine so I cannot add users or change the authentication method there. SQL Server不是我的,所以我不能添加用户或更改身份验证方法。

Is there a way that IIS/ASP.NET to impersonate (is that the term) user x? 有没有一种方法可以让IIS / ASP.NET模仿(就是那个术语)用户x?

看看这些链接是否有帮助: IIS模拟 IIS 7配置

Do you have Integrated Security=True in your connection string? 您的连接字符串中是否有Integrated Security = True

If so it's going to try to use the anonymous/IIS_USER account to access the DB instead of what you have in your connection string. 如果是这样,它将尝试使用匿名/ IIS_USER帐户来访问数据库而不是连接字符串中的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM