开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜