Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have publisher-subscriber kind of service architecture with netTCPbinding over the internet.

How can I make communication secure between service & subscribed client. currently I have security mode = "message" in development environment I am validating username & password using custom validation.

XML
<netTcpBinding>
       <binding name="netTcpBindingConfiguration" receiveTimeout="00:10:00">
         <reliableSession enabled="true" ordered="true" inactivityTimeout="00:10:00" />
         <security mode="Message">
           <transport clientCredentialType="None" protectionLevel="None" />
           <message clientCredentialType="UserName"/>
         </security>
       </binding>
     </netTcpBinding>



Here is the sample username validator class

C#
class UserNamePassValidator : System.IdentityModel.Selectors.UserNamePasswordValidator
   {
       public override void Validate(string userName, string password)
       {
           if(  userName==null ||  password==null)
           {
               throw new ArgumentNullException();
           }

           if (!(userName == "test" && password == "test") )
           {
               throw new FaultException("Incorrect Username or Password");
           }
       }
   }



--
Do I need some kind of encryption to encrypt the message communication. Does netTcpBinding is right choice over the internet? Actually I need to get some data back from wcf client using callback contact so I only have limited choice of bindings.
Posted

1 solution

Can you please have a look on that [^]
 
Share this answer
 
Comments
nileshinfotech84 9-May-12 11:01am    
Its over the internet so I can't use windows authentication because the computers are not in the same domain.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900