What's the .NET 4.5 equivalent to UserNameWSTrustBinding?

坚强是说给别人听的谎言 提交于 2019-12-06 17:25:22

问题


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.


回答1:


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;



回答2:


I ported the WCF bindings to thinktecture identity model:

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




回答3:


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.



来源:https://stackoverflow.com/questions/14511769/whats-the-net-4-5-equivalent-to-usernamewstrustbinding

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