-1

I have WCF web-service with windows authentification.

Binding

<bindings>
  <netTcpBinding>
    <binding name="CommonWindowsBinding" maxReceivedMessageSize="40000000" >
      <security mode="Transport">
        <transport clientCredentialType="Windows" />
      </security>
    </binding>
  </netTcpBinding>

</bindings>

Endpoint

    <endpoint address="Windows"
              binding="netTcpBinding" 
              bindingConfiguration="CommonWindowsBinding" 
              name="MyNameSpace.Contracts.ISimplePluginServiceWindows" 
              contract="MyNameSpace.Contracts.ISimplePluginService">
      <identity>
        <dns value="WCfServer" />
      </identity>
    </endpoint>

I want to pass additional information to service for such authentification (I check auth by using checking MS SQL Server's users and logins - I need to pass mssql server name and database name). So, I have to pass some custom data to validator => I have to make custom validator for Windows authentification. How can I do it? I couldn't find any examples.

For UserName authentification, I can do it by using CustomUserNameValidator (pass server address and database name with login), which inherits UserNamePasswordValidator.

Sir Hally
  • 2,318
  • 3
  • 31
  • 48

2 Answers2

1

Windows authentication is Windows (E.G. Kerberos). If you want to do you own authenticaiton then use password but I don't think it will let you pass additional information. And you really want to pass the server address and database name to the server?

Selecting a Credential Type

paparazzo
  • 44,497
  • 23
  • 105
  • 176
0

I realized, that it was commonly wrong approach.

  1. I can authentificate to MSSQL server with current Windows user's credentials from WCF service by using delegation - http://msdn.microsoft.com/en-en/library/ms730088.aspx

  2. If it is nessesary to pass additional data (such as server name and db name), such action should be performed by using special method in service contract.

Sir Hally
  • 2,318
  • 3
  • 31
  • 48