我将Web APP和Web API项目部署到Azure App Service . 使用Azure Active Directory为我的Web App和Web Api添加了身份验证 . 但是现在当我从Web App调用Web Api时,我遇到了错误 . 我已经在我的web api中启用了CORS .

XMLHttpRequest cannot load https://login.windows.net/2xxxxxxx/oauth2/autho…Fvalues%2FGetMaxDate&nonce=80daeef12xxxxxxxxxx_201xxxxxxx453. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

如果我从我的web api中删除Azure Active Directory身份验证,一切正常 . 但我无法从我的web api中删除身份验证,因为从浏览器输入api url将为用户提供json数据 .