07-23-2023, 03:21 AM
In my case the problem was in URL that calls Ajax.asmx this URL was not correct according to a webserver setup, e.g. `"/qa/Handlers/AjaxLib.asmx/"` worked for me instead of `"/Handlers/AjaxLib.asmx/"` (works fine on PROD servers in my particular situation):
$.ajax({
url: '/qa/Handlers/AjaxLib.asmx/' + action,
type: "POST",
async: false,
data: data,
contentType: "application/json; charset=utf-8",
success: function () {
My AJAX was then called out of scope of my IIS virtual application directory "qa", hence Authorization error occured `({"Message":"Authentication failed.","StackTrace":null,"ExceptionType":"System.InvalidOperationException"}).`
$.ajax({
url: '/qa/Handlers/AjaxLib.asmx/' + action,
type: "POST",
async: false,
data: data,
contentType: "application/json; charset=utf-8",
success: function () {
My AJAX was then called out of scope of my IIS virtual application directory "qa", hence Authorization error occured `({"Message":"Authentication failed.","StackTrace":null,"ExceptionType":"System.InvalidOperationException"}).`