On the client side, store the client identification (e.g: username&Password) in the custom message headers by using OperationContext.Current.OutgoingMessageHeaders property. and on the server side, you can get this custom message header by using OperationContext.Current.IncomingMessageHeaders
property. then you can validate the client identification before calling WCF service methods. For more about this, Please check this article to get help.
You can also use Soapheader to store your username and password in the request soap message and then on the on the server side, you can extract this Soapheader value using messageInspector, for more about this, check this article.
shabbir_215
Member
427 Points
417 Posts
Validate WCF Authentication using username and password
Jan 31, 2012 01:53 PM|LINK
Hi,
Anybody can give me basic example to authenticate WCF Webservices using username and password , I am using .net 4.0.
Thanks in Advance
Shabbir
kushalrdalal
Contributor
7128 Points
1270 Posts
Re: Validate WCF Authentication using username and password
Jan 31, 2012 02:16 PM|LINK
Check this tutorials -
http://codebetter.com/petervanooijen/2010/03/22/a-simple-wcf-service-with-username-password-authentication-the-things-they-don-t-tell-you/
My Blog
LinkedIn Profile
shabbir_215
Member
427 Points
417 Posts
Re: Validate WCF Authentication using username and password
Jan 31, 2012 03:18 PM|LINK
Can you provide me some other examples in details plzzzzzzzzzz
Peter pi - M...
Star
12871 Points
1786 Posts
Re: Validate WCF Authentication using username and password
Feb 03, 2012 06:41 AM|LINK
Hi,
On the client side, store the client identification (e.g: username&Password) in the custom message headers by using OperationContext.Current.OutgoingMessageHeaders property. and on the server side, you can get this custom message header by using OperationContext.Current.IncomingMessageHeaders property. then you can validate the client identification before calling WCF service methods. For more about this, Please check this article to get help.
http://blogs.microsoft.co.il/blogs/bursteg/archive/2006/04/23/141.aspx
You can also use Soapheader to store your username and password in the request soap message and then on the on the server side, you can extract this Soapheader value using messageInspector, for more about this, check this article.
http://weblogs.asp.net/paolopia/archive/2008/02/25/handling-custom-soap-headers-via-wcf-behaviors.aspx
Here is a similar post to which you can refer.
http://stackoverflow.com/questions/1976217/how-to-add-custom-soap-headers-in-wcf
Regards,
Peter
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework