我创建了具有Azure AD身份验证的ASP.net Core 2.1 Web项目。因此,它在appsettings.json中具有以下值。
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "mycompany.onmicrosoft.com",
"TenantId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"ClientId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"CallbackPath": "/signin-oidc"
},
它会自动将重定向URL设置为“ https:// localhost:44362 / signin-oidc”。该Web项目又调用ASP.Net Core 2.1 Web API来获取数据。我已经将两个项目都部署到了Azure App Services。
尝试访问已部署的Web应用程序后,出现错误消息“ 您无权查看此目录或页面。”
除了现有的本地主机URL,我还添加了以下重定向URL。
对于App Service,我已通过“使用Azure Active Directory登录”启用了“身份验证/授权”。并将管理模式配置为高级。
我已启用详细错误,其中包含以下信息。
<table border="0" cellpadding="0" cellspacing="0">
<tr class="alt"><th>Requested URL</th><td> https://myweb-Dev:80/signin-oidc</td></tr>
<tr><th>Physical Path</th><td> D:\home\site\wwwroot\signin-oidc</td></tr>
<tr class="alt"><th>Logon Method</th><td> Not yet determined</td></tr>
<tr><th>Logon User</th><td> Not yet determined</td></tr>
</table>
<div class="content-container">
<fieldset><h4>More Information:</h4>
This generic 403 error means that the authenticated user is not authorized to use the requested resource.
A substatus code in the IIS log files should indicate the reason for the 403 error. If a substatus code
does not exist, use the steps above to gather more information about the source of the error.
</fieldset>
</div>
请任何人帮助我确定并解决此问题。谢谢。