WCF服务的配置没有模拟指定的用户? [英] WCF service not impersonating specified user in config?

查看:79
本文介绍了WCF服务的配置没有模拟指定的用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用basicHttpBinding的一个基本的WCF服务。我有我的网站项目,我的服务项目。在我的网站项目中,我有我的服务项目的定期服务参考服务。在我的开发环境,它工作正常。然而,在我们分期的环境中,我们已经启用的服务应用程序模拟。该服务使用该用户的,当然连接到一个SQL数据库。

I have a basic WCF service using basicHttpBinding. I have my site project and my services project. In my site project, I have a regular Services Reference to a service in my services project. In my development environment, it works fine. However, in our staging environment, we have enabled impersonation on the services application. This service connects to a SQL database using this user, of course.

问题是,其他ASMX服务似乎模仿只是在web.config中定义的用户,WCF服务仍在运行的网站的用户,从而导致SQL身份验证失败的罚款。

The issue is, while the other ASMX services seem to impersonate just fine with the user defined in the web.config, the WCF service is still running as the site's user, causing SQL authentication to fail.

是否有额外的步骤,以使我的WCF服务模拟?我没有做什么特别的旁边添加:

Are there extra steps to enable impersonation for my WCF service? I have not done anything special beside adding:

service.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Delegation;

在我初始化从我的网站我的服务代理。思考?谢谢你。

After I initialize my service proxy from my website. Thoughts? Thanks.

推荐答案

如果你的意思是在web.config中配置ASP.NET模拟帐户不与WCF,除非你打开的 AspNetCompatibility 。 WCF不提供任何这样的配置。

If you mean ASP.NET impersonation account configured in web.config it doesn't work with WCF unless you turn on AspNetCompatibility. WCF doesn't offer any such configuration.

这篇关于WCF服务的配置没有模拟指定的用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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