Forms authorisation - how to redirect to a "you do not have sufficient permission" page???

From: Chris Lewis (chris.lewis@-nospam-exentra.no.spam.thanks.co.uk)
Date: 11/19/02


From: "Chris Lewis" <chris.lewis@-nospam-exentra.no.spam.thanks.co.uk>
Date: Tue, 19 Nov 2002 09:46:04 -0000


I have a Forms authentication and authorisation ASP.NET application, and I
have URL-based authorisation set up and working, set up in web.config as
follows:

<configuration>
  <system.web>
 <authentication mode="Forms">
  <forms name="Demo1Web" path = "/" loginUrl="Secure/LoginPage.aspx"
  protection="All" timeout="10">
  </forms>
 </authentication>
 <authorization>
  <allow users="*" />
 </authorization>
etc...

  </system.web>
</configuration>

etc...

<location path="Secure">
 <system.web>
  <authorization>
   <deny users="?"/>
  </authorization>
 </system.web>
</location>
<location path="Accounts">
 <system.web>
  <authorization>
   <allow roles="1, 2"/>
   <deny users="*"/>
  </authorization>
 </system.web>
</location>

What I'd like to know is, is there a way to automatically redirect to a page
other than the standard login page - i.e. a "sorry, you are not authorised
to do this" page?

Thanks, in anticipation.

Chris



Relevant Pages

  • Re: Forms authentication bug?
    ... I read alot of posts about forms authentication and came ... the name implies NOT open for anonymous users. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Forms Authentication errror
    ... I am trying to use Forms Authentication in a sample project. ... I have also included a web.config file in that folder with following ... configuration file required to service this request. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: how to let the web.config in the sub-directory to NOT to inherited from Roots web.config.
    ... the authorization mode for that directory, ... You can simply delete the whole authentication section ... >> How to let the sub-directory to avoid the authentication control from Root's webconfig? ... An error occurred during the processing of a configuration file required ...
    (microsoft.public.dotnet.framework.aspnet)
  • Allowed roles/users from the web.config
    ... Is it possible to get a list of allowed roles/users for a single page on the ... which use a role based forms authentication? ... there any standard implementation to access that configuration? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to limit access to admin subfolder using web.config file?
    ... <authentication mode="Forms"> ... Since this is an admin directory you might not want to give access to ...
    (microsoft.public.dotnet.framework.aspnet.security)