2

I have a WCF service exposed as a netTcpBinding.

On the service side:

<netTcpBinding>             
    <binding> 
      <security mode="Message">
        <message clientCredentialType="Windows"/>
      </security>         
    </binding>
</netTcpBinding> ...
// Service behavior
<behavior>         
    <serviceCredentials>
       <windowsAuthentication allowAnonymousLogons="true" />
     </serviceCredentials>          
</behavior>

I am unable to access this service from a anonymous user on another machine. (Error: Negotiation failed redentials could not be verified.)

What does

<windowsAuthentication allowAnonymousLogons="true" /> 

do?

I want my service to be accessible to both windows and anonymous users over net tcp binding. I can do this using UserName validation, but how do I do this using Windows authentication?

Thanks

SharePoint Newbie
  • 5,974
  • 12
  • 62
  • 103

2 Answers2

3

Have you set the AllowedImpersonationLevel on the client?

<behaviors>
    <endpointBehaviors>
      <behavior>
        <clientCredentials>
          <windows allowedImpersonationLevel="Anonymous"/>
        </clientCredentials>
      </behavior>
    </endpointBehaviors>
</behaviors>

or

client.ClientCredentials.Windows.AllowedImpersonationLevel = 
System.Security.Principal.TokenImpersonationLevel.Anonymous;
The other other Alan
  • 1,868
  • 12
  • 21
0

The MSDN article Debugging Windows Authentication Errors points out the need to combine your service configuration with the client configuration mentioned by @user1467261. It points to another article on impersonation in WCF for more detail - but glossing over it, the need to combine these settings is not entirely obvious.

sfuqua
  • 5,797
  • 1
  • 32
  • 33