16

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.

user2009176
  • 161
  • 1
  • 3
  • 3
    I would love to know where this is as well. Or what the workaround is...not really wanting to install a third party Thinktecture resource. – Steve Jul 19 '13 at 20:03
  • 1
    Google searches yield umpteen results for ".net 4.5" examples that USE UserNameWSTrustBinding, despite MSDN being very clear that it has been deprecated. So, I'm with you, I'd desperately like to know how you're supposed to go about this in 4.5 – ctb Feb 26 '14 at 17:32

3 Answers3

4

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;
molnarm
  • 9,856
  • 2
  • 42
  • 60
1

I ported the WCF bindings to thinktecture identity model:

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

leastprivilege
  • 18,196
  • 1
  • 34
  • 50
0

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.

Les
  • 10,335
  • 4
  • 40
  • 60