asmx web service authorization
I have asmx web service(c#). I'm using Windows Authentication to access web service. Now i need to provide some of web service methods only for speciefic use开发者_StackOverflow中文版r, for example Test. I cant find examples of such Authorization. Some examples of code would be appreciated.
I don't think that web service have such restriction per memeber. Probably you will need to check the user rights inside of the web service members
[WebMethod]
public void HelloWorld()
{
if (this.DoesUserHaveRights(HttpContext.Current.User))
{
// do the work here
}
else
throw new AuthenticationException();
}
or somethign like this
精彩评论