C# 从WCF请求中检索域名

C# 从WCF请求中检索域名,c#,wcf,C#,Wcf,我使用以下代码从WCF操作上下文检索域名 WindowsIdentity identity = OperationContext.Current.IncomingMessageProperties.Security.ServiceSecurityContext.WindowsIdentity; domain = identity.Name.Split('\\')[0]; 当我部署时,它在我的机器中按预期工作,结果域名总是作为NT权限出现 部署服务器运行Windows server 2008 R

我使用以下代码从WCF操作上下文检索域名

WindowsIdentity identity = OperationContext.Current.IncomingMessageProperties.Security.ServiceSecurityContext.WindowsIdentity;
domain = identity.Name.Split('\\')[0];
当我部署时,它在我的机器中按预期工作,结果域名总是作为NT权限出现

部署服务器运行Windows server 2008 R2和IIS 7。我正在使用basicHttpBinding,下面是绑定配置。有人能指出我做错了什么吗

<basicHttpBinding>
        <binding name="BasicHttpBinding_IIdentityService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="Transport">
            <transport clientCredentialType="Ntlm" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>