Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude WebService from form authentication

I have a web site with a few pages and a WebService. I am using form authentication.

I want to exclude the WebService from the form authentication, so that it will be available to all even when you did not do login.

How can I do that?

Thanks

like image 434
jkally Avatar asked Oct 19 '25 03:10

jkally


1 Answers

Try to use location element for your service in your web.config and specify that all users can access the service by using:

<configuration>
   <!-- rest of your web.config -->

   <location path="MyService.asmx">
      <system.web>
         <authorization>
            <allow users="*"/>
         </authorization>
      </system.web>
   </location>
</configuration>

If this doesn't help you can also change authentication mode to none in the location element. If you have multiple services you can place them to separate folder and use single location element for whole folder.

like image 115
Ladislav Mrnka Avatar answered Oct 21 '25 19:10

Ladislav Mrnka