在Azure App Service中托管的ASP.NET Core 6 MVC应用程序后,获得401.1错误
我已经使用ASP.NET Core 6 MVC应用程序创建了一个应用程序。我正在使用Microsoft.Identity平台进行身份验证(Azure AD身份验证)。它在当地工作正常。用户能够登录和登录并能够导航。使用错误的密码或用户名登录时,用户会遇到错误。 但是,当在Azure App Service上托管相同的代码以及访问应用程序时,发生401错误。我如何解决这个问题。正如我提到的那样,一切在本地工作正常,因此注册客户ID或任何其他注册级别信息都没有问题。
webconfig文件
/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.
WebConfig file
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如该问题所述,如果启用了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.