【问题标题】:Permission issue + Azure AD权限问题 + Azure AD
【发布时间】:2021-02-04 00:14:18
【问题描述】:

我创建了带有 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 应用服务。

当我尝试访问已部署的 Web 应用程序时,我收到错误消息“您无权查看此目录或页面。

除了现有的本地主机 URL,我还添加了以下重定向 URL。

对于应用服务,我已通过“使用 Azure Active Directory 登录”启用“身份验证/授权”。并将管理模式配置为高级。

我启用了包含以下信息的详细错误。

    <table border="0" cellpadding="0" cellspacing="0"> 
    <tr class="alt"><th>Requested URL</th><td>&nbsp;&nbsp;&nbsp;https://myweb-Dev:80/signin-oidc</td></tr> 
    <tr><th>Physical Path</th><td>&nbsp;&nbsp;&nbsp;D:\home\site\wwwroot\signin-oidc</td></tr> 
    <tr class="alt"><th>Logon Method</th><td>&nbsp;&nbsp;&nbsp;Not yet determined</td></tr> 
    <tr><th>Logon User</th><td>&nbsp;&nbsp;&nbsp;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> 

请任何人帮助我识别并解决此问题。谢谢。

【问题讨论】:

  • 您能否通过 KUDU 验证您已将应用部署到正确的位置:site/wwwroot ?
  • 是的 Kgalic。实际上我只是通过选择现有的应用服务从 VS 发布它。
  • 您的 Azure 网站中有默认页面吗?确保将启动文件(例如:index.htm)添加到默认文档部分。
  • 是的,卡尔。因为是 ASP.Net Core Application,所以默认页面是hostingstart.html。

标签: azure azure-active-directory asp.net-core-2.1 azure-appservice


【解决方案1】:

不确定问题出在哪里。您可以尝试通过以下方式进行故障排除:

  1. 尝试重启网络应用,进入应用服务>你的网络应用>概览>点击重启。

  2. 启用 Azure AD 应用程序服务身份验证:

【讨论】:

  • 谢谢卡尔。但我已经启用了它。这不是我的问题的解决方案。
【解决方案2】:

正如我发布的那样,我已经使用身份验证(工作或学校帐户)创建了项目本身。所以我删除了应用服务级别的身份验证配置。这解决了我的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-02
    • 1970-01-01
    • 2020-05-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多