Doubt in Forms authentication configuration settings

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Doubt in Forms authentication configuration settings

    In Asp.net forms authentication. In order to restrict certain files from
    anonymous users the settings in web.config should be
    <deny users="?"/>
    which will not allow anonymous users.
    My doubt is, Though .NET classes are able to detect the difference between
    the anonymous users and authenticated users then why it's not made like
    <allow users="<certain symbol>"/>
    which will allow the authenticated users only.
    Is there any particular reason by restricting with deny keyword
    ?
    Please make it clear
    Thanks in advance
    Naveen Kumar Guest

  2. Similar Questions and Discussions

    1. Configuration Error using Forms Authentication
      I am authenticating users with a database table. I am using Forms Authentication, and I am able to login, but when I want to register I get this...
    2. Timeout Settings Doubt!!!
      Hi All, What's the difference between Timeout on the Webservice proxy object and Timeout on the auto generated Proxy // foo.aspx.cs...
    3. ASP.Net Forms authentication with basic authentication popup
      Relatively new to ASP.Net but have a strange problem. My site uses forms authentication for a large administration section however after the user...
    4. Forms authentication then redirection to a secure web with NT authentication?
      Hi, I want to allow access to particular secured intranet web sites. These intranet are stored in sharepoint (2003 version) Actually I've...
    5. Forms Authentication - GenericPrincipal- How to use web.config configuration
      MSDN has good articles that explains how to use GenericPrincipal objects with forms authentication. For instance,...
  3. #2

    Default Re: Doubt in Forms authentication configuration settings

    Hi,

    settings between <authorization> tag (<llow> or <deny>) are evaluated in the
    order they are placed. This is described in docs:

    "
    At run time, the authorization module iterates through the <allow> and
    <deny> tags until it finds the first access rule that fits a particular
    user. It then grants or denies access to a URL resource depending on whether
    the first access rule found is an <allow> or a <deny> rule. The default
    authorization rule in the Machine.config file is <allow users="*"/> so, by
    default, access is allowed unless configured otherwise.
    "

    And if you check this page where I took this text:
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfauthorizationsection.asp[/url]

    There are told that ? (question mark) means anonymous users, * (asterisk)
    means all users. Therefore to limit the access by default, you need to deny
    the access from unauthenticated users, so that they get redirected to the
    logon page and possibly get authenticated.

    But why there isn't "allow all authenticated" users is probably due to that
    it is easier to say who should be able access certain restricted page, like
    that to allow admins only to certain section (and denies all other users,
    despite being authenticated or not)

    <authorization>
    <allow roles="admins"/>
    <deny users="*"/>
    </authorization>

    I cannot speak for the ASP.NET team, but IMO this way the settings are more
    explicit, (semantically denying all unauthenticated users is the same as
    allowing all authenticated however allowing users case-by-case is then more
    explicit) , as it should be so that access is denied by default unless there
    is a reason to access that page.

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU






    "Naveen Kumar" <Naveen [email]Kumar@discussions.microsoft.com[/email]> wrote in message
    news:A4FBB9C0-B52A-405B-BC04-79BF05CFD45A@microsoft.com...
    > In Asp.net forms authentication. In order to restrict certain files from
    > anonymous users the settings in web.config should be
    > <deny users="?"/>
    > which will not allow anonymous users.
    > My doubt is, Though .NET classes are able to detect the difference between
    > the anonymous users and authenticated users then why it's not made like
    > <allow users="<certain symbol>"/>
    > which will allow the authenticated users only.
    > Is there any particular reason by restricting with deny keyword
    > ?
    > Please make it clear
    > Thanks in advance

    Teemu Keiski Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139