When trying to use the HTTP basic auth post I am getting this popup and no matter when I enter can not get past it?
var FreeAgentConsumerKey = '@ViewBag.FreeAgentConsumerKey';
var FreeAgentConsumerSecret = '@ViewBag.FreeAgentConsumerSecret';
var GrantType = '@ViewBag.GrantType';
var Code = '@ViewBag.Code';
var ReturnUrl = '@ViewBag.ReturnUrl';
var SendToUrl = '@ViewBag.SendToUrl';
$.ajax({
type: 'POST',
url: SendToUrl,
data: { username: 'John', password: 'Smith', grant_type: GrantType, code: Code, redirect_uri: ReturnUrl },
dataType: "json",
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", "Basic" + btoa(FreeAgentConsumerKey + ":" + FreeAgentConsumerSecret));
},
xhrFields: {
withCredentials: true
},
success: function (result) {
var token = result;
},
error: function (req, status, error) {
alert(error);
}
});