.NET Framework Bookmark and Share   
 index > Windows Communication Foundation > Custom Binding using Message Level Security with Username and Password
 

Custom Binding using Message Level Security with Username and Password

Hi,
I want to create a custom binding that uses Message Level Security with Username and Password programmatically (C# preferred)
I have gone through MSDN and googling butnever came across anything useful that explains which SecurityBindingElement should I be using (Symmetric/Assymmetric)and how to configure it to use Message Level Security with Username and Password with code ( not config)

Can someone please help me?
nick_tej
Hi Nick,
you can choose one between:
SymmetricSecurityBindingElement userNameForCertificate = SecurityBindingElement.CreateUserNameForCertificateBindingElement();
SymmetricSecurityBindingElement userNameForSsl = SecurityBindingElement.CreateUserNameForSslBindingElement();
SymmetricSecurityBindingElement userNameOverTransport = SecurityBindingElement.CreateUserNameOverTransportBindingElement();
depends on your solution.
More info:

http://msdn.microsoft.com/en-us/library/aa702632.aspx
http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.securitybindingelement.createusernameovertransportbindingelement.aspx
http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.securitybindingelement.createusernameforsslbindingelement.aspx
http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.securitybindingelement.createusernameovertransportbindingelement.aspx

HTH
Fabio Cozzolino Blogs: http://dotnetside.org/blogs/fabio http://weblogs.asp.net/fabio
Fabio Cozzolino

You can use google to search for other answers

Custom Search

More Threads

• The security token manager cannot create a token authenticator for requirement (NotSupportedException)
• sharing data contracts between projects
• Where to put certificate information
• Get singleton instance at server side
• peerchannel and duplex operations
• The operation has timed-out exception (HTTPS, basicHttpBinding)
• How to completely get rid of "http://tempuri.org/" within a WSDL WITHOUT using a app.config file?
• WCF Message Certificate Security
• TCP Mex data - server name
• More Info: MessageContract(IsWrapped=true) doesn't allow minOccurs control over elements in Wrapped complexType