Custom Error pages

Discussion in 'ASP .Net Security' started by Rich, Jan 26, 2005.

  1. Rich

    Rich Guest

    Hi All,

    I have a windows authenticated web site - a sub directory
    has been secured by denying various roles. When access is
    denied the default error page for 401.2 is displayed -
    How can I customise my own access denied page?
    I have tried custom error tags in the web.config but that
    doesnt seem to work, nor does changing the IIS error page
    settings.

    Any ideas?

    Cheers,
    Rich
     
    Rich, Jan 26, 2005
    #1
    1. Advertising

  2. Rich

    Ken Schaefer Guest

    You can attempt to customise the page (and IIS will send the customised
    page - you can check using network sniffer), but it is up to the browser to
    decide what to display. Most (if not all) browsers will *not* display custom
    content when the HTTP status from the server is 401 - they will either
    display a logon dialogue box -or- they will display an "access denied" error
    message (after three, or whatever, failed attempts). This is a security
    measure on the part of the browser.

    What you would need to do is intercept the 401.2 HTTP status, and change it
    to something else (eg 200 OK), and then you can server whatever content you
    want.

    Cheers
    Ken

    "Rich" <> wrote in message
    news:07d601c503c0$5959aae0$...
    > Hi All,
    >
    > I have a windows authenticated web site - a sub directory
    > has been secured by denying various roles. When access is
    > denied the default error page for 401.2 is displayed -
    > How can I customise my own access denied page?
    > I have tried custom error tags in the web.config but that
    > doesnt seem to work, nor does changing the IIS error page
    > settings.
    >
    > Any ideas?
    >
    > Cheers,
    > Rich
    >
     
    Ken Schaefer, Jan 27, 2005
    #2
    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. Mike Speak

    CUSTOM ERROR PAGES

    Mike Speak, Nov 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    349
    John Soulis [MSFT]
    Nov 6, 2003
  2. Steve Klett

    using custom error pages w/ runtime errors

    Steve Klett, Nov 12, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    386
    Steve Klett
    Nov 12, 2003
  3. Kenneth Keeley

    Custom Error Pages

    Kenneth Keeley, Nov 13, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    457
    Kenneth Keeley
    Nov 13, 2003
  4. =?Utf-8?B?Umh5czY2Ng==?=

    Custom Error Pages

    =?Utf-8?B?Umh5czY2Ng==?=, Mar 30, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    381
    =?Utf-8?B?Umh5czY2Ng==?=
    Mar 30, 2005
  5. Brian Munroe

    Custom Error Pages in ASP.NET - Global.asax

    Brian Munroe, Apr 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,206
    Brian Munroe
    Apr 28, 2005
Loading...

Share This Page