WCF Web Services - Impersonates Multiple Hops on a Single Server

I have 3 web services that are located on the same server.

My client calls service A, which represents the client to call service B, and all is well.

Now I want to impersonate caller B (which is my username) to call service C. When I use the same method as before (AllowedImpersonationLevel = Impersonate, user.Impersonate ()), the user does not receive C for service. Instead service C sees the user as the user I run in IIS (which is UPN, not the standard NETWORK SERVICE account).

Is there anything special I need to do to get this to work? Is this a delegation question? (I thought this would not be delegation, because they are all on the same server)

Thank you SO!

+3
source share
3 answers

. - ImpersonationLevel.Delegation( ). WCF codeplex, . , , , , . , , , , SQL Server, .., , (SPN).

0

ASP.Net C

Web.cofig

<system.web>
   <identity impersonate="true"/>
   <authentication mode="Windows"/>
</system.web>
<system.serviceModel>
   <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Service : IService
{
    public string ExecuteRequest(string xmlRequest)
    {
        IRequestManager requestManager = new RequestManager();
        return requestManager.ProcessRequest(xmlRequest);
    }

}
0

, , . TokenImpersonationLevel.Delegation?

0
source

Source: https://habr.com/ru/post/1747201/


All Articles