开发者

asmx web service authorization

开发者 https://www.devze.com 2023-04-01 00:26 出处:网络
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 T

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

精彩评论

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