Re: Page level forms Authentication

From: Teemu Keiski (joteke_at_aspalliance.com)
Date: 07/01/03

  • Next message: DanR_at_REMOVETHISTOGETTOME-warshawgroup.com: "Problems with Forms Auth and Session State."
    Date: Tue, 1 Jul 2003 23:26:36 +0300
    
    

    By setting authentication normally as you would and then the alternative
    permissions by using <location> tag.

    Something like (irrelevant part snipped out):

    <?xml version="1.0" encoding="utf-8" ?>

    <configuration>

    <system.web>

    ...

    <!--

    <authentication> tag as it would normally be with Forms auth.
    Removed from this example to keep it simple

    //-->

    <authorization>

        <!-- By default pages are denied for unauthenticated users //-->

        <deny users="?" />

    </authorization>

    ...

    </system.web>

    <!--

    All users can access page1.aspx

    //-->

    <location path="page1.aspx">

        <system.web>

            <authorization>

                <allow users="*" />

            </authorization>

        </system.web>

    </location>

    <!--

    All users can access page2.aspx

    //-->

    <location path="page2.aspx">

        <system.web>

            <authorization>

                <allow users="*" />

            </authorization>

        </system.web>

    </location>

    </configuration>

    -- 
    Teemu Keiski
    MCP, Designer/Developer
    Mansoft tietotekniikka Oy
    http://www.mansoft.fi
    ASP.NET Forums Moderator, www.asp.net
    AspAlliance Columnist, www.aspalliance.com
    Email:
    joteke@aspalliance.com
    "dave" <dy@onlinelg.com> wrote in message
    news:019301c34008$129c3910$a501280a@phx.gbl...
    > What would the web.config file look like if i need to
    > perform the following?
    >
    > I have 3 pages in the root directory that need to have
    > forms authentication.  I also have 3 more in the root
    > directory that must be available to everyone.
    >
    > I cannot split up into directories (this would be easier)
    > but the means of access must be at the root level for
    > some other reasons.
    >
    > thank you very much in advance.
    > dave
    

  • Next message: DanR_at_REMOVETHISTOGETTOME-warshawgroup.com: "Problems with Forms Auth and Session State."

    Relevant Pages

    • Re: ASP.NET Authentication exception case
      ... It doesn't seem to like the authorization tag underneath the location tag ... This section sets the authentication policies of the application. ... <!-- SESSION STATE SETTINGS ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: can I set web.config to require authentication only for some files?
      ... correctly (it had to go just before the closing tag ... one authentication method for one set of pages and a different ... that always gave a run-time error. ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: Getting Virtual Directory not configured error
      ... if you have a root web.config and a sub-directory web.config file, that could explain the error you mentioned if the either one is not configured correctly. ... i would be happy to test your configuration on my own IIS server. ... i will assume that the IIS 'application' is created on the subdirectory, as you indicated in your original post. ... authentication mode in the root web.config and another web.config file (the ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: can I set web.config to require authentication only for some files?
      ... You can specify some pages to require login, and others to not require login ... via your web.config file by using the tag. ... > What if I want to configure authentication so that it's only required ...
      (microsoft.public.dotnet.framework.aspnet)
    • can I set web.config to require authentication only for some files?
      ... What if I want to configure authentication so that it's only required ... to specify in the tag or in the tag that you ... sub-directory under the top-level project directory, ...
      (microsoft.public.dotnet.framework.aspnet)