Setting up authorization behavior

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

  1. #1

    Default Setting up authorization behavior

    Hello:

    I have what I thought was a simple requirement, but I've not been able to
    figure out a solution yet.

    I am using Forms authentication. If someone navigates to my web address,
    say, [url]www.foo.com[/url] (fictitious), I want them to see an aspx page, such as
    index.aspx. The problem is that I have to use this

    <authorization>
    <deny users="?" />
    </authorization>

    XML in my web.config file. If I do not, then the redirect feature will not
    work. (The redirect feature I'm referring to is the Forms tag's loginUrl
    attribute. This URL causes a redirect to automatically occur if a user hits
    a page that requires authentication. It is suppsed to also create a
    querystring value that holds a reference to the page the user originally
    navigated to so that it can return (redirect) to that page after successful
    authentication.) If I do not deny users as above then this redirect with
    querystring doesn't work. I get redirected to the login page, but no
    querystring value appears.

    So, this means that all pages in the root require authentication. So I have
    created a folder under the root called "noauth" and have placed pages there.
    That folder has its own web.config file, and it specifies this:

    <authorization>
    <allow users="?" />
    </authorization>

    This works.

    However, I have to redirect all users who hit [url]www.foo.com[/url] to a sub-folder,
    and this just seems strange.

    Is there a way to allow free (no-authorization) access to root pages and
    also have the redirect-with-querystring feature work?

    Thank you for any help.


    Scott Simes Guest

  2. Similar Questions and Discussions

    1. Strange behavior when setting gridview selected index
      Hello there, I have an asp.net 2.0 web app that uses gridview and formview. When a user selects an item in the gridview the formview appears to...
    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. Setting up a FP shooter type camera behavior
      ive looked at a couple of models like the macromedia maze magic example, and some others involving mouse input for camera rotation, and key input...
    4. 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...
    5. Setting and locking behavior properties via score generation session
      Dear potential savior, Is there a way to set and lock(so that newly set variables stay) the properties of behaviors that are usually defined by...
  3. #2

    Default RE: Setting up authorization behavior

    Scott

    Yes, there is a way to allow all users free access to some items, and authorized access to other items. In your web.config file, just above or below the <system.web> element, you will input the following

    <location path="mypage.aspx"><system.web><authorization><all ow users="?" /></authorization></system.web></location

    You can set that configuration for each of the items that you want to allow all unknown/unauthenticated users to be able to see.
    David Coe 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