Passing user ID through layers using ASP.NET and WCF

I am new to WCF. Let's say I have two asp.net applications that use Windows Authentication (an intranet application), as well as an application that uses forms authentication (an Internet application). I want both of these applications to have a link to the service on a physically separate computer, where all my business logic will live (in WCF). So, the application is as follows:

Browser -> ASP.NET -> WCF. When the call ends at the WCF level, I need to know the username obtained by ASP.net (User.Identity.Name).

With .NET Remoting, I created a custom principle that I hid in a LogicalCallContext. Then, using the user remote receiver on the remote server side, I set the current main stream for the principal to LogicalCallContext.

What is the right way to do something similar with WCF? Again, my WCF service can only be called by an ASP.NET service account, but I need to know who is ultimately on behalf of.

+3
source share
2 answers

Does your service verify WCF and trust ASP.NET applications (for example, using Windows authentication to authenticate the service account under which ASP.NET applications run).

, SOAP.

gory WCF ClientMessageInspector, SOAP DispatchMessageInspector, SOAP .

+2

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


All Articles