微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

权限问题+ Azure AD

如何解决权限问题+ Azure AD

我创建了具有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>&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> 

请任何人帮助我确定并解决此问题。谢谢。

解决方法

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

  1. 尝试重新启动Web应用程序,请转到“应用程序服务”>“ Web应用程序”>“概述”>单击“重新启动”。

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

enter image description here

,

正如我所张贴的,我已经使用身份验证(工作或学校帐户)创建了项目本身。因此,我在应用程序服务级别删除了身份验证配置。这解决了我的问题。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?