We have a rather large application my team and I are developing that contains a number of WCF NetTCP-based services. The Windows service this system will be running under won't be a local account, but instead a standard domain user (with admin privileges on the servers hosting the service). In the middle of testing connectivity I ran into an issue where SSPI calls fail. Based on a few hours of research this has led me down the path of me missing the following line from my client config:
<identity>
<userPrincipalName value="MACHINE\user" />
</identity>
The problem with using this is I don't use VS or svcutil to generate a client/proxy for this service - the proxies being used are completely written in code and they inherit System.ServiceModel.ClientBase. I believe the original reason this option was chosen was so we could use the exact same DataMember objects that pass through the services on either side of the fence - third party groups won't need to connect to our services so this wasn't a problem.
Does anyone know a way for me to set userPrincipalName in the client (code or through a config) when I don't have endpoints specified in the standard system.serviceModel configuration section?
Here's what my client-side web.config looks like for reference:
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true"
logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<behaviors>
<serviceBehaviors>
<behavior name="includeExceptions">
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_Default" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="Infinite" sendTimeout="01:00:00" portSharingEnabled="true" transferMode="Buffered" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign"/>
</security>
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>