AM getting error as 401 unauthorized while calling AJAX call... When i debug error throws in setRequestHeader.
$.ajax({
type: "GET",
xhrFields: {
withCredentials: true
},
crossDomain: false,
beforeSend: function (d, c) {
d.setRequestHeader("Authorization", "Bearer " + IportalauthContext.GetOauthToken(iPortal.global.common.DefaultResource))
},
url: b,
dataType: "json",
success: function (c) {
renderFooter(c.value[0], pageName);
fOpenHeight = fOpen.outerHeight();
$(".tOpen").css("bottom", fOpenHeight - 27);
fOpen.addClass("fOpen");
fOpen.removeAttr("style")
},
error: function (d, c) {
console.log("Error")
} })
Please provide me a suggestion or solution to track this issue.
