I have a web service (WCF or ASMX doesn’t matter)… I have made a Console application, right-clicked, added service referrence. So far, so good.
However, I cannot for the life of me pass ‘security’ credentials across to my service. This is my client code:
var client = new MyClient(); client.ClientCredentials.UserName.UserName = 'bob'; client.ClientCredentials.UserName.Password = '123!!'; client.HelloWorld(); client.Close();
But on the server, no matter what I do (aspnetcompant mode on and off, wcf service, asmx service, custom http handlers, etc)… I can’t find ‘bob:123!!’ anywhere. Not in headers, not in HttpContext.Current.User.Identiy.Name, not in Thread.CurrentPrincipal… nothing.
What am I missing here?
Yes I have, and apparently if you don’t use SSL, .Net throws an exception. So apparently you can’t do what I want without SSL.