连接字符串中的集成安全性

发布于 2024-08-02 19:27:44 字数 555 浏览 1 评论 0原文

我只是尝试使用此连接字符串将 WCF 服务移至 Windows 身份验证

WCF 服务托管在 IIS (2003) 中,我在“目录安全性”下设置的用户就像我们为此应用程序设置的用户,该用户在 SQL 中具有权限设置。此应用程序的应用程序池设置在“网络服务”用户下运行,但在尝试使用该服务时出现此异常。

System.Data.SqlClient.SqlException:用户“Domain\MAchineName$”登录失败

我与我们的系统管理员交谈,他说用户名末尾的 $ 意味着如果尝试验证而不是用户,则机器本身。

关于为什么机器尝试进行身份验证而不是 IIS 中的用户设置有什么想法吗?

I just tried to move a WCF service to windows authentication using this connection string

<add name="MembershipConnection" connectionString="Data Source=DBADDRESS ;Initial Catalog=aspNetMembership;Persist Security Info=True;Integrated Security=SSPI;"/>

The WCF service is hosted in IIS (2003) and the user I have setup under 'Directory Security' as the user we have setup for this app that has permission setup in SQL. The Application Pool setup for this app is running under 'Network Service' user, but I get this exception when trying to use the service.

System.Data.SqlClient.SqlException: Login failed for user 'Domain\MAchineName$'

I talked to our system admin and he says that the $ at the end of the user-name means that the machine itself if trying to authenticate not the user.

any ideas on why the machine is trying to authenticate rather than the user setup in IIS?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

醉生梦死 2024-08-09 19:27:44

实际上,它的工作方式如广告所示:“网络服务”用户将作为任何远程连接的计算机进行身份验证。来自 msdn 文档此处

在上下文中运行的服务
NetworkService 帐户呈现
计算机的远程凭据
服务器

如果您需要特定帐户,则需要创建它并将应用程序池设置为在该帐户下运行。

如果您想以用户身份进行身份验证,则需要设置委派。

Actually, it's working as advertised: The "Network Service" user will authenticate as the machine for any remote connections. From msdn docs on ithere :

A service that runs in the context of
the NetworkService account presents
the computer's credentials to remote
servers

If you want a specific account, you'll need to create it and set up the app pool to run under that account.

If you want to authenticate as the user, you'll need to set up delegation.

想你的星星会说话 2024-08-09 19:27:44

您需要配置您的服务来模拟调用者(简单的部分,例如使用[OperationBehavior(Impersonation = ImpersonationOption.Required)]),然后您需要设置 IIS 以进行受限委派。请参阅

You need to configure your service to impersonate the caller (the easy part, eg. using [OperationBehavior(Impersonation = ImpersonationOption.Required)]) then you'll need to set up IIS for contrained delegation. See

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文