问题
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