English 中文(简体)
在一个窗口服务的窗口中,妇女论坛能否从网上应用程序中吸引一个域窗户。
原标题:Can a WCF hosted in windows service impersonate a domain windows caller from asp.net web application?
  • 时间:2011-11-11 11:22:20
  •  标签:
  • asp.net
  • wcf

I have a web application that has reference of the wcf service which is deployed on a windows service. Web user sends a request to WCF service which then calls a stored procedure. Web application is running under Windows Authentication and Impersonate ticked. WCF is running as wshttp binding.

This is all located on same machine. I want the WCF service to impersonate the web application user. Is this possible? Can someone please guide me how to achieve it?

感谢。

最佳回答

Yes this is possible. There are some minor limitations if the application and service are running on the same system, but your scenario should not suffer from that. From How to: Impersonate a Client on a Service:

When the client and service are running on the same computer and the client is running under a system account (that is, Local System or Network Service), the client cannot be impersonated when a secure session is established with stateful Security Context tokens. A WinForms or console application typically is run under the currently logged in account, so that account can be impersonated by default. However, when the client is an ASP.NET page and that page is hosted in IIS 6.0 or IIS 7.0, then the client does run under the Network Service account by default. All of the system-provided bindings that support secure sessions use a stateless Security Context token by default. However, if the client is an ASP.NET page and secure sessions with stateful Security Context tokens are used, the client cannot be impersonated.

如果您的服务是窗口服务,则没有具体限制。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签