权限问题 + Azure AD
Permission issue + 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.NetCore 2.1 WebAPI获取数据。我已将这两个项目部署到 Azure App Services。
一旦我尝试访问已部署的 Web 应用程序,我收到错误消息“您无权查看此目录或页面。”
除了现有的本地主机 URL.
之外,我还添加了以下重定向 URLs
- https://myweb-dev.azurewebsites.net
- https://myweb-dev.azurewebsites.net/signin-oidc
- https://myweb-dev.azurewebsites.net/.auth/login/aad/callback
对于应用服务,我启用了“身份验证/授权”和“使用 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>
请任何人帮我找出并解决这个问题。谢谢。
不确定问题出在哪里is.You可以尝试通过以下方式排查:
尝试重新启动 Web 应用程序,转到应用服务 > 您的 Web 应用程序 > 概述 > 单击重新启动。
启用 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.NetCore 2.1 WebAPI获取数据。我已将这两个项目部署到 Azure App Services。
一旦我尝试访问已部署的 Web 应用程序,我收到错误消息“您无权查看此目录或页面。”
除了现有的本地主机 URL.
之外,我还添加了以下重定向 URLs- https://myweb-dev.azurewebsites.net
- https://myweb-dev.azurewebsites.net/signin-oidc
- https://myweb-dev.azurewebsites.net/.auth/login/aad/callback
对于应用服务,我启用了“身份验证/授权”和“使用 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>
请任何人帮我找出并解决这个问题。谢谢。
不确定问题出在哪里is.You可以尝试通过以下方式排查:
尝试重新启动 Web 应用程序,转到应用服务 > 您的 Web 应用程序 > 概述 > 单击重新启动。
启用 Azure AD 应用程序服务身份验证:
正如我发布的那样,我已经使用身份验证(工作或学校帐户)创建了项目本身。所以我删除了应用服务级别的身份验证配置。这解决了我的问题。