【发布时间】:2021-03-04 09:41:49
【问题描述】:
所以我开发了一个带有 Windows 身份验证的 API。当我使用 Visual 的 Studio IIS Express 运行项目时 - 端点受以下保护:
[Authorize(AuthenticationSchemes = IISDefaults.AuthenticationScheme)]
在我注册的服务中:
services.AddAuthentication(IISDefaults.AuthenticationScheme);
获取当前的 Windows 用户,我可以通过 HttpContextAccessor 访问。
在我将应用程序发布到 Windows Server(启用 HTTPS)并运行 IIS 10 后,当我尝试访问受保护的端点时,我只会收到登录提示,我输入的内容并不重要,只有在以下情况下才会消失我取消了。
Windows IIS Server 中的 My Site 设置,Windows Auth 使用 Negotiate Provider: 应用程序池设置:
我能做些什么来解决这个问题吗?如果这篇文章缺少一些其他信息,请告诉我,我会编辑它。
【问题讨论】:
标签: iis .net-core windows-authentication