【问题标题】:WCF Changing credentialsWCF 更改凭据
【发布时间】:2012-10-05 17:18:27
【问题描述】:

我有一个 Web 应用程序,它在不同的服务器(Web 服务器、应用程序服务器和数据库服务器)上调用具有多个服务的 WCF Web 应用程序,所有这些服务都使用 basicHttBinding。其中一项服务必须连接到必须使用活动目录帐户调用的数据库。从网站进来的用户是匿名的。

我已获得设置此用户的凭据,但我无法让它工作。我像这样在网络服务器上创建我的频道:

ChannelFactory<T> channelFactory = GetChannelFactoryFromPool<T>(enpointAddress);       
channelFactory.Credentials.Windows.ClientCredential.UserName = username;
channelFactory.Credentials.Windows.ClientCredential.Password = password;
channelFactory.Credentials.Windows.ClientCredential.Domain = domain;
proxy = channelFactory.CreateChannel();

在应用服务器上的服务中,我试图通过这样做来确定凭据是否正确:

var ssc = ServiceSecurityContext.Current;

但 ssc 始终为空。这可以用 basicHttpBinding 完成吗?

谢谢, 保罗

【问题讨论】:

    标签: wcf impersonation credentials basichttpbinding


    【解决方案1】:

    basicHttpBinding 确实支持documented in this good MSDN article. 的 Windows 身份验证您还需要确保将服务操作配置为 allow impersonation of the client credentials 以按预期填充安全上下文。

    【讨论】:

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