0

我有一个使用 Windows 集成安全性的 Web 应用程序。我还有一个作为本地系统运行的 Windows 服务。Web 应用程序使用 .NET 远程处理通过 tcpip 通道在服务上执行方法。在 .NET 2.0 上,有没有办法将 Windows 身份传递给服务?

4

1 回答 1

0

根据 MSDN 文档,配置客户端和服务器 app.config 文件。

服务器:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.runtime.remoting>
        <application>
            <channels>
              <channel ref="tcp" secure="true" impersonate="true" />
             </channels>
        </application>
    </system.runtime.remoting>
</configuration>

客户:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.runtime.remoting>
        <application>
            <channels>
              <channel ref="tcp" secure="true" tokenImpersonationLevel="impersonation"/>
             </channels>
        </application>
    </system.runtime.remoting>
</configuration>

请注意,对于服务器,该属性称为 impersonate,但对于客户端,该属性称为 tokenImpersonationLevel。

请参阅:http: //msdn.microsoft.com/en-us/library/59hafwyt (VS.85).aspx

于 2009-03-24T00:33:11.690 回答