什么是与UserNameWSTrustBinding等效的.NET 4.5? [英] What's the .NET 4.5 equivalent to UserNameWSTrustBinding?

查看:90
本文介绍了什么是与UserNameWSTrustBinding等效的.NET 4.5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am converting a active profile STS to the new .NET 4.5 System.IdentityModel framework. My code using the UserNameWSTrustBinding which doesn't seem to exist in the new framework. Any suggestions.

推荐答案

尽管这是一个老问题,但我在互联网上找不到任何非第三方的答案,因此它是:

Although this is an old question, I couldn't find any non-third-party answer on the internet, so here it is:

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

To replace UserNameWSTrustBinding in .NET 4.5, use the following:

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

这篇关于什么是与UserNameWSTrustBinding等效的.NET 4.5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆