What is the best approach to implementing authorisation/authentication for a Windows Forms app talking to an IIS-hosted RESTful WCF Service?
The reason I ask is I am
Using Basic authentication:
WebHttpBinding binding = new WebHttpBinding();
binding.SendTimeout = TimeSpan.FromSeconds(25);
binding.Security.Mode = WebHttpSecurityMode.TransportCredentialOnly;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
Uri address = new Uri("http://localhost:3525/WcfRestWeb/Quotes.svc");
WebChannelFactory factory =
new WebChannelFactory(binding, address);
factory.Credentials.UserName.UserName = "tan";
factory.Credentials.UserName.Password = "wani";
IQuoteService proxy = factory.CreateChannel();
var response = proxy.GenerateQuote(GetQuoteRequest());
Console.WriteLine("Quote Amount: " + response.QuoteAmount);