using <location> with <authorization>

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

  1. #1

    Default using <location> with <authorization>

    I need help with specifics of using <location> with <authorization>.

    I started with
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetauthorization.asp?frame=true[/url]
    At the bottom of the page, there is a cryptic reference to the "<location>"
    tag - but no explaination of how to use it.

    I found
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetch08.asp[/url]
    which explains it better, but there is also, the KB article
    [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;316871[/url] which suggests
    that the <system.web> section is INSIDE the <location> tag, which doesn't
    seem to be right, but since I can't get it to work I can't say for sure.

    I currently have:

    <configuration>
    --- some other stuff ---
    <authentication mode="Windows" />
    <authorization>
    <allow roles="group1, group2"/>
    <deny users="?" />
    </authorization>
    <location path="error.aspx">
    <authorization>
    <allow users ="*" />
    </authorization>
    </location>

    <location path="CreateReciept.asmx">
    <authorization>
    <allow users ="?" />
    </authorization>
    </location>

    I am aware that '*' and '?' are different - I've been experimenting. I also
    tried adding a <system.web> tag outside the main body and putting the special
    location tags there, which is more what the KB article (above) indicates.

    I'd like to see an example, including specifically an example of setting
    certain Windows groups for access to the site generally, but anonymous access
    for special pages, such as an error page and the web service. The current
    behavior is to require membership in one of the listed groups in order to
    access any of the site, including the pages that I've attempted to override
    the settings for.
    Erik Sargent Guest

  2. Similar Questions and Discussions

    1. Error: That location is controlled by another site.Please choose another location
      Hi, I was wondering if anybody came across this error before: "That location is controlled by another site. Please choose another location" I am...
    2. URL Authorization
      Hi All, I am trying to write several applications, for external users. They will use forms authentication to login. My question concerns url...
    3. authorization for sub directory
      Hi All, Could anybody advise me for the following.. I want to restrict access to a subdirectory in an web application which has "integrated...
    4. <location> path authorization is not properly checked for override restrictions
      Hi, This is to make developers aware of a possible problem that shows up in the authentication mechanism in the Web.Config files. Here is the...
    5. ASP.NET Authorization
      I'd like to use role in Forms authentication and I found the following words from .net SDK about ASP.NET Authorization. " Identifies a targeted...
  3. #2

    Default Re: using <location> with <authorization>

    You can use the standard :-

    <configuration>
    <system.web>
    ......
    </system.web>
    </configuration>

    but you can also have the <location> element within the <configuration>
    element, and the <location> element also contains another <system.web>
    series of elements so....

    <configuration>
    <system.web>
    ......
    </system.web>
    <location path="somefileorDir.aspx">
    <system.web>
    .........
    </system.web>
    </location>
    </configuration>

    --

    - Paul Glavich
    ASP.NET MVP
    ASPInsider ([url]www.aspinsiders.com[/url])

    "Erik Sargent" <ErikSargent@discussions.microsoft.com> wrote in message
    news:F014D4C8-4F14-4B73-8D7C-5A8ED5F2B5A1@microsoft.com...
    > I need help with specifics of using <location> with <authorization>.
    >
    > I started with
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetauthorization.asp?frame=true[/url]
    > At the bottom of the page, there is a cryptic reference to the
    "<location>"
    > tag - but no explaination of how to use it.
    >
    > I found
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetch08.asp[/url]
    > which explains it better, but there is also, the KB article
    > [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;316871[/url] which
    suggests
    > that the <system.web> section is INSIDE the <location> tag, which doesn't
    > seem to be right, but since I can't get it to work I can't say for sure.
    >
    > I currently have:
    >
    > <configuration>
    > --- some other stuff ---
    > <authentication mode="Windows" />
    > <authorization>
    > <allow roles="group1, group2"/>
    > <deny users="?" />
    > </authorization>
    > <location path="error.aspx">
    > <authorization>
    > <allow users ="*" />
    > </authorization>
    > </location>
    >
    > <location path="CreateReciept.asmx">
    > <authorization>
    > <allow users ="?" />
    > </authorization>
    > </location>
    >
    > I am aware that '*' and '?' are different - I've been experimenting. I
    also
    > tried adding a <system.web> tag outside the main body and putting the
    special
    > location tags there, which is more what the KB article (above) indicates.
    >
    > I'd like to see an example, including specifically an example of setting
    > certain Windows groups for access to the site generally, but anonymous
    access
    > for special pages, such as an error page and the web service. The current
    > behavior is to require membership in one of the listed groups in order to
    > access any of the site, including the pages that I've attempted to
    override
    > the settings for.

    Paul Glavich [MVP ASP.NET] Guest

  4. #3

    Default Re: using <location> with <authorization>

    whilst looking for information about the <location> element yesterday I
    found this, it may help it may not :)

    [url]http://www.asp101.com/articles/matt/securesite/default.asp[/url]

    Ollie Riches

    "Erik Sargent" <ErikSargent@discussions.microsoft.com> wrote in message
    news:F014D4C8-4F14-4B73-8D7C-5A8ED5F2B5A1@microsoft.com...
    > I need help with specifics of using <location> with <authorization>.
    >
    > I started with
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetauthorization.asp?frame=true[/url]
    > At the bottom of the page, there is a cryptic reference to the
    "<location>"
    > tag - but no explaination of how to use it.
    >
    > I found
    >
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetch08.asp[/url]
    > which explains it better, but there is also, the KB article
    > [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;316871[/url] which
    suggests
    > that the <system.web> section is INSIDE the <location> tag, which doesn't
    > seem to be right, but since I can't get it to work I can't say for sure.
    >
    > I currently have:
    >
    > <configuration>
    > --- some other stuff ---
    > <authentication mode="Windows" />
    > <authorization>
    > <allow roles="group1, group2"/>
    > <deny users="?" />
    > </authorization>
    > <location path="error.aspx">
    > <authorization>
    > <allow users ="*" />
    > </authorization>
    > </location>
    >
    > <location path="CreateReciept.asmx">
    > <authorization>
    > <allow users ="?" />
    > </authorization>
    > </location>
    >
    > I am aware that '*' and '?' are different - I've been experimenting. I
    also
    > tried adding a <system.web> tag outside the main body and putting the
    special
    > location tags there, which is more what the KB article (above) indicates.
    >
    > I'd like to see an example, including specifically an example of setting
    > certain Windows groups for access to the site generally, but anonymous
    access
    > for special pages, such as an error page and the web service. The current
    > behavior is to require membership in one of the listed groups in order to
    > access any of the site, including the pages that I've attempted to
    override
    > the settings for.

    Ollie 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