Excluding page authorization in a form authentication directory

Discussion in 'ASP .Net' started by Gnic, Mar 21, 2006.

  1. Gnic

    Gnic Guest

    Hi,

    I am a page that sit on a form authentication directory, but I have 1 or 2
    pages that don't require form authentication, also I have a web service
    class in this directory as well, I am wondering how can I exclude those aspx
    and asmx from form authentication?

    thanks

    Gnic
     
    Gnic, Mar 21, 2006
    #1
    1. Advertising

  2. You can configure special settings by using the <location> element in the
    web.config. For example, this allows anonymous users to access
    mywebservice.asmx.

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <location path="mywebservice.asmx" >
    <system.web>
    <authorization>
    <allow users="?" />
    </authorization>
    </system.web>
    </location>
    ....

    Here's more info:

    How To Make Application and Directory-Specific Configuration Settings in an
    ASP.NET Application

    http://support.microsoft.com/default.aspx?scid=kb;en-us;815174

    Ken
    Microsoft MVP [ASP.NET]


    "Gnic" <> wrote in message
    news:...
    > Hi,
    >
    > I am a page that sit on a form authentication directory, but I have 1 or 2
    > pages that don't require form authentication, also I have a web service
    > class in this directory as well, I am wondering how can I exclude those
    > aspx and asmx from form authentication?
    >
    > thanks
    >
    > Gnic
    >
     
    Ken Cox - Microsoft MVP, Mar 21, 2006
    #2
    1. Advertising

  3. Gnic

    Gnic Guest

    That works for .NET framework 1.x, but in 2.0, it requires the sub directory
    to be an IIS application inorder to use the location element.

    My problem is that my ASP hosting service doesn't allow us to create IIS
    application in sub folder, that's why I have to put everything in one
    folder.

    So, is there any way that I can exclude some of the pages from Form
    Authentication in a single directory?

    thanks

    Gnic



    "Ken Cox - Microsoft MVP" <> wrote in message
    news:...
    > You can configure special settings by using the <location> element in the
    > web.config. For example, this allows anonymous users to access
    > mywebservice.asmx.
    >
    > <configuration
    > xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    > <location path="mywebservice.asmx" >
    > <system.web>
    > <authorization>
    > <allow users="?" />
    > </authorization>
    > </system.web>
    > </location>
    > ...
    >
    > Here's more info:
    >
    > How To Make Application and Directory-Specific Configuration Settings in
    > an ASP.NET Application
    >
    > http://support.microsoft.com/default.aspx?scid=kb;en-us;815174
    >
    > Ken
    > Microsoft MVP [ASP.NET]
    >
    >
    > "Gnic" <> wrote in message
    > news:...
    >> Hi,
    >>
    >> I am a page that sit on a form authentication directory, but I have 1 or
    >> 2 pages that don't require form authentication, also I have a web service
    >> class in this directory as well, I am wondering how can I exclude those
    >> aspx and asmx from form authentication?
    >>
    >> thanks
    >>
    >> Gnic
    >>

    >
    >
     
    Gnic, Mar 21, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Cook
    Replies:
    1
    Views:
    406
    Harley
    Aug 7, 2003
  2. Frank Rizzo
    Replies:
    2
    Views:
    3,068
    Frank Rizzo
    Jan 12, 2004
  3. =?Utf-8?B?U2FtYmE=?=

    Excluding certian pages from Forms authentication

    =?Utf-8?B?U2FtYmE=?=, Aug 1, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    468
    =?Utf-8?B?VmlqYXk=?=
    Aug 30, 2005
  4. Norman Crandall

    Excluding a directory from build.

    Norman Crandall, Jan 13, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    367
    Joshua Flanagan
    Jan 13, 2006
  5. SeanRW
    Replies:
    1
    Views:
    396
    Dominick Baier [DevelopMentor]
    May 25, 2006
Loading...

Share This Page