【问题标题】:What's the .NET 4.5 equivalent to UserNameWSTrustBinding?与 UserNameWSTrustBinding 等效的 .NET 4.5 是什么?
【发布时间】:2013-01-08 19:47:10
【问题描述】:

我正在将活动配置文件 STS 转换为新的 .NET 4.5 System.IdentityModel 框架。我的代码使用了新框架中似乎不存在的 UserNameWSTrustBinding。任何建议。

【问题讨论】:

  • 我也很想知道这是哪里。或者解决方法是什么...不是真的想安装第三方 Thinktecture 资源。
  • Google 搜索为使用 UserNameWSTrustBinding 的“.net 4.5”示例产生了无数结果,尽管 MSDN 非常清楚它已被弃用。所以,我和你在一起,我非常想知道你应该如何在 4.5 中解决这个问题

标签: .net-4.5 wif


【解决方案1】:

虽然这是一个老问题,但我在互联网上找不到任何非第三方的答案,所以这里是:

要在 .NET 4.5 中替换 UserNameWSTrustBinding,请使用以下命令:

var binding = new WS2007HttpBinding(SecurityMode.{what it was before});
binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;

【讨论】:

    【解决方案2】:

    我将 WCF 绑定移植到 thinktecture 身份模型:

    https://github.com/thinktecture/Thinktecture.IdentityModel.45

    【讨论】:

      【解决方案3】:

      我也很难为 .NET 4.5 找到不是第三方库的东西。但是我遇到了this link 的代码,您可以将其包含在您的项目中。

      【讨论】:

        猜你喜欢
        • 2012-12-14
        • 1970-01-01
        • 2018-08-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-06-03
        相关资源
        最近更新 更多