title: How to pass credentials to WCF service hosted on azure using jquery?
body: <p>I have hosted WCF service on my azure site and now i am trying to consume it using jquery.
  I need to know how should i pass azure site credentials to service? i am trying ways but still getting access denied. In console application i was able to pull data and also insert data into azure SQL server table using service refernce (my WCF have two operation contracts). Trying the same with jquery.</p>
  
  <p>Here jquery code where i am passing creds:</p>
  
  <pre><code>$.ajax({   
      type: "GET",   
      dataType: "json",
      url:"http://myazuresite.azurewebsites.net/Service1.svc/GetToolsByAuthor",
      data: '{ author: ToolAuthor }',
      beforeSend : function(req) {
          req.setRequestHeader('Authorization', 
          getcreds(user, pass));
      },
      processData: true,
      success: function (data) {  
          alert('data retreived');                
      },              
      error: function (XMLHttpRequest, textStatus, errorThrown) {
          alert(errorThrown);
      }
  });
  
  function getcreds(username, password) {
      var tok = user + ':' + password;
      return tok;
  }
  </code></pre>
  
  <p>Any help or pointers would be greatly appreciated.</p>