Forms Authentication - Supress displaying the login page for certain web pages

Discussion in 'ASP .Net Security' started by Felix Wafytech, Jul 18, 2006.

  1. Hi All,

    I'm using forms authentication. Opening any page would lead to the login
    page if the user is not currently logged in. This is fine. But I would like
    certain public pages to be displayed irrespective of whether the user has
    logged in or not. Is there a way to stop the authentication mechanism for
    public pages without changing the directory in which it exists?

    Note: I'm using a master page and changing the directory would lead to
    images not appearing due to the change in directory.

    If this isn't possible, then the only solution I see is to create a new
    master page and place the file in a different directory. Is this the only
    option?

    Thanks in advance,
    Felix.J
     
    Felix Wafytech, Jul 18, 2006
    #1
    1. Advertising

  2. use a <location path="publicPage.aspx"> element and set the autorization
    settings for individual files or folders..


    > Hi All,
    >
    > I'm using forms authentication. Opening any page would lead to the
    > login page if the user is not currently logged in. This is fine. But I
    > would like certain public pages to be displayed irrespective of
    > whether the user has logged in or not. Is there a way to stop the
    > authentication mechanism for public pages without changing the
    > directory in which it exists?
    >
    > Note: I'm using a master page and changing the directory would lead to
    > images not appearing due to the change in directory.
    >
    > If this isn't possible, then the only solution I see is to create a
    > new master page and place the file in a different directory. Is this
    > the only option?
    >
    > Thanks in advance,
    > Felix.J
     
    Dominick Baier, Jul 18, 2006
    #2
    1. Advertising

  3. Thanks for Dominick's informative suggestion.

    Hi Felix,

    As Dominick has suggested, you can use the <location> element to grant
    specific <authorization> setting for individual pages or directories in the
    ASP.NET web application.

    #How to: Configure Specific Directories Using Location Settings
    http://msdn2.microsoft.com/en-us/library/ms178692.aspx

    For example, the following configuration sections customize the application
    to allow anomymous(unauthenticated) user to access the "ContactUS.aspx"
    page and the "PublicUsers" sub directory under the application root dir:

    ==============================

    <configuration >

    <location path="ContactUS.aspx">
    <system.web>
    <authorization>
    <allow users="*"/>
    </authorization>
    </system.web>
    </location>

    <location path="PublicUsers">
    <system.web>
    <authorization>
    <allow users="*"/>
    </authorization>
    </system.web>
    </location>
    ....................
    ==============================

    If there is anything unclear or any other information you need, please feel
    free to post here.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    ==================================================

    Get notification to my posts through email? Please refer to

    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial

    response from the community or a Microsoft Support Engineer within 1
    business day is

    acceptable. Please note that each follow up response may take approximately
    2 business days

    as the support professional working with you may need further investigation
    to reach the

    most efficient resolution. The offering is not appropriate for situations
    that require

    urgent, real-time or phone-based interactions or complex project analysis
    and dump analysis

    issues. Issues of this nature are best handled working with a dedicated
    Microsoft Support

    Engineer by contacting Microsoft Customer Support Services (CSS) at

    http://msdn.microsoft.com/subscriptions/support/default.aspx.

    ==================================================



    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng[MSFT], Jul 19, 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. Eric
    Replies:
    2
    Views:
    1,497
    Tommy
    Feb 13, 2004
  2. Paul Aspinall
    Replies:
    1
    Views:
    362
    Mark Fitzpatrick
    Oct 1, 2006
  3. =?Utf-8?B?TWF4IFR1cmF2YW5p?=

    Forms authentication for certain pages

    =?Utf-8?B?TWF4IFR1cmF2YW5p?=, Feb 6, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    540
    =?Utf-8?B?TWF4IFR1cmF2YW5p?=
    Feb 6, 2007
  4. Pascal Blanchard
    Replies:
    0
    Views:
    248
    Pascal Blanchard
    Aug 17, 2004
  5. Pascal Blanchard
    Replies:
    1
    Views:
    281
    Pascal Blanchard
    Aug 18, 2004
Loading...

Share This Page