0

我遇到了一个问题,我无法确定 App 1 和 App 2 之间的区别。这两个应用程序都从Session_Start()Global.asax 中执行下面完全相同的代码行。一个应用程序正确识别用户DOMAIN\USER,另一个应用程序只是返回''......

UserService.GetUserInfo(Context.User.Identity.Name.ToString());

这两个应用程序在 Web.config 中都有这个用于使用 Windows 身份验证。

<authentication mode="Windows"></authentication>
4

1 回答 1

1

您可以在本地使用支持 Windows 身份验证的 IIS Express 对其进行测试。因此,在您的 web.config 中,您必须具有以下内容:

<authentication mode="Windows" />

并在项目的属性中配置 IIS Express 以启用 Windows 身份验证:

在此处输入图像描述

Anonymous Authentication必须设置为Disabled并且Windows Authentication必须设置为Enabled

于 2012-10-12T10:53:29.243 回答