【问题标题】:How to pass on user's identity from web application hosted in one IIS to the web service hosted in another IIS?如何将用户身份从一个 IIS 中托管的 Web 应用程序传递到另一个 IIS 中托管的 Web 服务?
【发布时间】:2013-01-07 22:24:21
【问题描述】:

我有一个 Web 应用程序(在 ASP.net 4.0 中开发)托管在 IIS 6.0 上的 Windows Server 2003 R2 机器上。 Integrated Windows Authentication 已为此 Web 应用程序打开。

我在IIS 7.5Windows Server 2008 R2 机器上托管了一个Web 服务(使用WCF 开发)。 'Windows Authentication 也为此 Web 应用程序启用。

  • 我使用 Windows 域帐户登录到本地计算机。当我浏览 Web 应用程序时,它会询问我的域用户名和密码。在网络应用程序中,我正确地获得了我的身份。
  • 从我的机器(使用其他一些 Winform 应用程序),如果我调用同一个 Web 应用程序(Web 服务的),服务代码将以我的 Windows 身份执行。

所以Integrated Windows Authentication 对于托管在不同机器上的不同 IIS 中的两个 Web 应用程序独立工作。

当从我的本地计算机浏览 Web 应用程序并且网页在内部调用该服务时,就会出现问题。在这种情况下,“服务没有在我的 Windows 身份下运行”正如预期的那样。它可以在 asp.net Web 应用程序或 Web 服务的 Web 应用程序的应用程序池的标识下运行。

我不希望我的 Web 服务负责对用户进行身份验证。它将使用简单的basicHttpBinding。它只会使用CurrentPrincipalHttpContext 等读取用户的名称。验证用户的身份只能由IIS 完成。

有人可以帮我将我的 Windows 身份从一个 IIS 传递到另一个吗?

【问题讨论】:

    标签: asp.net wcf iis windows-authentication impersonation


    【解决方案1】:

    您需要设置 kerberos 委托,因为默认情况下不会将身份传递给另一台机器。

    http://blogs.technet.com/b/askds/archive/2008/11/25/fun-with-the-kerberos-delegation-web-site.aspx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多