Nikita
Nikita

Reputation: 173

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 user, for example Test. I cant find examples of such Authorization. Some examples of code would be appreciated.

Upvotes: 1

Views: 1131

Answers (1)

Samich
Samich

Reputation: 30095

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

Upvotes: 1

Related Questions