title: How to get the service's method name in custom UserNamePasswordValidator
body: <p>I use <code>UserNamePasswordValidator</code> in my WCF-service. As I know, there is imposible to off this validation for some specific method inside service. That's why I'm trying to get the method's name in <code>Validate</code> method for skiping validation if client call this concrete method. But I don't know where I can find it.</p>
  
  <p>P.S. <code>OperationContext.Current</code> object is nulleable inside <code>Validate</code> method</p>
  
  <p><strong>Edited</strong>:
  Here is my service:</p>
  
  <pre><code>public class MyService : IMyService
  {
      public HttpStatusCode InserOrUpdate(string param1, long param2, int param3)
      {
          ...
      }
  
      public string GetPublicKey()
      {
          ...
      }
  }
  </code></pre>
  
  <p>And here is my custom validator:</p>
  
  <pre><code>public class CustomUserNamePasswordValidator : UserNamePasswordValidator
  {
      public override void Validate(string userName, string password)
      {
          if(/* currentServiceMethodName == "GetPublicKey" */)
          {
              return;
          }
  
          // Next code decrypts userName/password and checks permissions in DB. 
  
      }
  }
  </code></pre>
  
  <p>Web.config:</p>
  
  <pre><code>...
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="ServiceBehavior"&gt;
        ...
        &lt;serviceCredentials&gt;
          &lt;userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="MyNamespace.CustomUserNamePasswordValidator, MyNamespace" /&gt;
        &lt;/serviceCredentials&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  ...
  </code></pre>