What's the .NET 4.5 equivalent to UserNameWSTrustBinding?

独自空忆成欢 提交于 2019-12-05 00:32:07

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

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;

I ported the WCF bindings to thinktecture identity model:

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

I also had a hard time finding something that for .NET 4.5 that was not a third party library. But I came across this link for code you can include in your project.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!