Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It turns out I was able to do what I wanted with the custom binding using the following binding configuration:</p> <pre><code>&lt;customBinding&gt; &lt;binding name="NewBinding0"&gt; &lt;httpTransport authenticationScheme="Ntlm" keepAliveEnabled="false" /&gt; &lt;/binding&gt; &lt;/customBinding&gt; </code></pre> <p>Then, on the client side, I could use the following code to get the identity of the application pool the WCF service was running under (in IIS) as well as the identity of the user who actually called the WCF service:</p> <pre><code>public string GetData(int value) { var callingUser = string.Empty; var appPoolUser = WindowsIdentity.GetCurrent().Name; var identities = OperationContext.Current.ServiceSecurityContext.AuthorizationContext.Properties["Identities"] as IList&lt;IIdentity&gt;; if (identities != null) { var result = from i in identities where i.AuthenticationType == "NTLM" select new { i.Name }; if (result.Count() &gt; 0) { callingUser = result.First().Name; } } return string.Format("Value Entered: {0}; AppPool User: {1}; Calling User: {2}", value, appPoolUser, callingUser); } </code></pre> <p>I tested the above code in a load balanced environment, for Requirement #1, and everything seemed to run just fine. The tests simulated a 100-user load for 10 minutes in a load balanced environment. We took one of the load balanced servers down during the test and everything continued to run as expected (i.e. no exceptions were thrown during the tests nor did any identities come back incorrectly).</p> <p>The code above is the key piece, for Requirement #2, that I was missing - i.e. I didn't realize until this research that WCF would give you multiple identities.</p> <p>Also, using this configuration, the results of the WCF call is not encrypted (which is what we wanted). So, I think this configuration will work for our situation just fine.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload