title: WCF username and password without SSL and Custom Authentication Class
body: <p>i'm new with WCF and security in general.
  I'm trying to implement a basic authentication in WCF without using SSL and using a custom class (by inheriting the class UserNamePasswordValidator) for validating username and password. I don't want to use a certificate, in fact, for what i need, i just need to send username and pasword without any encryption.</p>
  
  <p>When i tried to configure my WCF service (based on this [link](<a href="http://developers.de/blogs/damir_dobric/archive/2006/07/31/890.aspx" rel="nofollow">http://developers.de/blogs/damir_dobric/archive/2006/07/31/890.aspx</a>" link")), by setting the security mode of the credential type as "TransportCredentialOnly" and the binding type as "basicHttpBinding", after trying to consume this service in a console application test, the authentication doesn't work (actually, i put a breakpoint in the authentication class and it is never stops there).</p>
  
  <p>This is how my Web.Config looks like
      
        
          
        
      </p>
  
  <pre><code>&lt;bindings&gt;
    &lt;basicHttpBinding&gt;
      &lt;binding name="BeneficiarioServiceBasicBinding"&gt;
        &lt;security mode="TransportCredentialOnly"&gt;
          &lt;transport clientCredentialType="None" proxyCredentialType="None" /&gt;
          &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
        &lt;/security&gt;
      &lt;/binding&gt;
    &lt;/basicHttpBinding&gt;
  &lt;/bindings&gt;
  
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="ServiceBehaviour.BeneficiarioService" &gt;
        &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
        &lt;serviceCredentials&gt;
          &lt;userNameAuthentication  userNamePasswordValidationMode="Custom"
                                   customUserNamePasswordValidatorType="WCF.Configuration.ServicoAutenticacao, ProgramasSociais.WCF" /&gt;
        &lt;/serviceCredentials&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;protocolMapping&gt;
    &lt;add binding="basicHttpsBinding" scheme="https" /&gt;
  &lt;/protocolMapping&gt;
  &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /&gt;
  </code></pre>
  
  <p></p>
  
  <hr>
  
  <p>Authentication Class (just a test class)</p>
  
  <pre><code>public class ServicoAutenticacao : UserNamePasswordValidator
  {
      public override void Validate(string userName, string password)
      {
          if (userName != "Test" &amp;&amp; password != "Test")
          {
              throw new FaultException("Invalid user and/or password");
          }
      }
  }
  </code></pre>
  
  <p>I found some similar problems here in stack overflow, however, i did not find any solution that fix my problem.</p>
  
  <p>Thanks,</p>