我收到消息
{ "Message": "Authorization has been denied for this request." }
当尝试使用来自https://github.com/AzureADQuickStarts/AppModelv2-WebAPI-DotNet的 API 时,如下面的邮递员屏幕截图所示:
我正在尝试从 js 文件中调用它
$.ajax({
type: "GET",
url: window.config.webApi + "TodoList/Get",
headers: {
'Authorization': 'Bearer ' + accessToken,
},
}).done(function (data) {
logMessage("Web APi returned:\n" + JSON.stringify(data));
})
.fail(function (jqXHR, textStatus) {
logMessage("Error calling the Web api:\n" + textStatus);
});