Does the WCF service not impersonate the specified user in the configuration?

I have a basic WCF service using basicHttpBinding. I have a project for my site and my service. In my site project, I have a regular service service for a service in my services project. In my development environment, it works fine. However, in our middleware environment, we have included the impersonation of a service application. Of course, this service connects to the SQL database using this user.

The problem is that other ASMX services seem to perfectly impersonate the user specified in web.config, the WCF service still works as a site user, which causes SQL authentication to fail.

Are there any additional steps to enable the impersonation of my WCF service? I did nothing special besides adding:

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

After I initialize my service proxy on my website. Thoughts? Thank.

+1
source share
1 answer

If you mean the ASP.NET impersonation account configured in web.config, it does not work with WCF unless you enable AspNetCompatibility . WCF does not offer such a configuration.

+1
source

All Articles