I'm creating a web service (asmx) in c# and everything works fine except that everyone can connect to it. What I want to do is enable user-password protection (web service is hosted by iis 7.5) so client would use it like this:
using(var client = new SoapClient())
{
client.ClientCredentials.UserName.UserName = "UserName";
client.ClientCredentials.UserName.Password = "Password";
var result = client.CallWebServiceMethod();
}
What should I do with iis to enable it?
这是一个有用的链接Web服务安全性
最简单的解决方案是禁用网站的Anonymous Acces,然后为每个客户端创建Windows帐户。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.