在Azure App Service中托管的ASP.NET Core 6 MVC应用程序后,获得401.1错误

发布于 2025-02-03 21:49:10 字数 931 浏览 2 评论 0原文

我已经使用ASP.NET Core 6 MVC应用程序创建了一个应用程序。我正在使用Microsoft.Identity平台进行身份验证(Azure AD身份验证)。它在当地工作正常。用户能够登录和登录并能够导航。使用错误的密码或用户名登录时,用户会遇到错误。 但是,当在Azure App Service上托管相同的代码以及访问应用程序时,发生401错误。我如何解决这个问题。正如我提到的那样,一切在本地工作正常,因此注册客户ID或任何其他注册级别信息都没有问题。

webconfig文件

”在此处输入图像说明”

appservice配置

​/I.SSTATIC.NET/316NH.png“ alt =”在此处输入图像描述”>

I have created an app using ASP.NET Core 6 MVC application. I am using the Microsoft.Identity platform for authentication (Azure AD authentication). It worked fine locally. User is able to sign-in and sign-out and able to navigate. When signing in with wrong password or username then user getting an error.
But when hosted the same code on Azure App Service and when accessing the app the 401 error occured. HOw I fix that issue. As I mentioned everything works fine locally so no issue with registration clientId or any other registration level info.

enter image description here

WebConfig file

enter image description here

AppService configuration
enter image description here

enter image description here

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神仙妹妹 2025-02-10 21:49:10

如该问题所述,如果启用了Azure Active Directory,则无需明确登录和注销。当您尝试在本地进行这些操作时,必须在本地配置它们。在Azure App Service中移动和访问时,它会引起相同的错误。

请检查配置中的以下内容:

1。 IIS的配置在部署之前

2。 AAD的配置

这两个步骤可以解决问题。

As mentioned in the question, if you enabled Azure Active Directory, there is no need to you to login and logout explicitly. As you are trying to do those operations locally, it must be they are not configured perfectly locally also. The same error it is causing while moving and accessing in Azure App Service.

Kindly check the following things in configuration:

1. Configuration of IIS before deployment

2. Configuration of AAD

These two steps could solve the issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文