Exclude from Form Authentication

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Islam Elkhayat

    Exclude from Form Authentication

    How can i exclude some files from the Form Authentication. . my welcome page
    and even custom error pages (404) is not working before authenticate.
    need help


  • jongalloway

    #2
    Re: Exclude from Form Authentication

    You can exclude specific files from forms auth with a location node in
    web.config:
    <location path="404.aspx" >
    <system.web>
    <authorizatio n>
    <allow users="*" />
    </authorization>
    </system.web>
    </location>

    <location path="welcome.a spx">
    <system.web>
    <authorizatio n>
    <allow users="*" />
    </authorization>
    </system.web>
    </location>

    It's often easier to just group the pages that don't require auth into
    a public folder and allow access to the whole folder at once:

    <location path="public/">
    <system.web>
    <authorizatio n>
    <allow users="*" />
    </authorization>
    </system.web>
    </location>

    More here:

    - Jon


    Comment

    • Islam Elkhayat

      #3
      Re: Exclude from Form Authentication

      Thanx alot.. I have searched alot to solve this...
      I was trying to put files in a public folder by add web.config to the public
      folder but this generate exception even if i excluded it from the project i
      must delete it to work..
      Is the web.config only one file for all my application so i can have only
      one file in my solution??


      "jongallowa y" <jongalloway@gm ail.com> wrote in message
      news:1104053483 .455681.279120@ f14g2000cwb.goo glegroups.com.. .[color=blue]
      > You can exclude specific files from forms auth with a location node in
      > web.config:
      > <location path="404.aspx" >
      > <system.web>
      > <authorizatio n>
      > <allow users="*" />
      > </authorization>
      > </system.web>
      > </location>
      >
      > <location path="welcome.a spx">
      > <system.web>
      > <authorizatio n>
      > <allow users="*" />
      > </authorization>
      > </system.web>
      > </location>
      >
      > It's often easier to just group the pages that don't require auth into
      > a public folder and allow access to the whole folder at once:
      >
      > <location path="public/">
      > <system.web>
      > <authorizatio n>
      > <allow users="*" />
      > </authorization>
      > </system.web>
      > </location>
      >
      > More here:
      > http://msdn.microsoft.com/library/de...ionelement.asp
      > - Jon
      > http://weblogs.asp.net/jgalloway
      >[/color]


      Comment

      Working...