javascript - How to Pass UserName & Password in Ajax -


i created odata services custom authentication, how pass username & password in ajax. note without having security below code working fine.

please on this

below code

var _url = "http://localhost:49497/dataservice.svc/mst_user?$filter=us_name eq 'basit' , us_password eq 's'&$format=json";  $.ajax({                 type: "get",                 url: _url,                 timeout: 10000,                 async: true,                 datatype: "json",                 contenttype: "application/jsonp; charset=utf-8",                 success: function (data)                      debugger;                     //                                        if (data.d.length > 0 && data.d[0].us_admin == 1) {                           var adminrole = data.d[0].us_adminmodule                         var usno = data.d[0].us_no                       } else {                         alter(‘login failed’)                     }                 },                 error: function (xhr, status, error) { // flow comes in error callback url returns true , issue.                         alter(‘login failed’)                 }             });         }     }; 

thanks basit


Comments