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.
I realized, that it was commonly wrong approach.
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
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.