Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Forms authentication: how to redirect unauthorized users?

Reply
Thread Tools

Forms authentication: how to redirect unauthorized users?

 
 
BJ Lap
Guest
Posts: n/a
 
      11-17-2005
Hi,

I implemented forms authentication in my web site.
This works fine but for one thing:
If an authenticated user tries to navigate to a page for which this user has
no access,
(this is specified in web.config files in several directories in the web
site), the user is redirected to the logon page. But I want the user to be
redirected to an 'acces denied' page. How can that be accomplished?

Thanks,
Bert-Jan


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      11-18-2005
You need to check on your login page to see if Request.IsAuthenticated. This
will tell you they've been redirected and they're already logged in. You
can then let them know they've tried to access a page that they don't have
access to.

-Brock
DevelopMentor
http://staff.develop.com/ballen

> Hi,
>
> I implemented forms authentication in my web site.
> This works fine but for one thing:
> If an authenticated user tries to navigate to a page for which this
> user has
> no access,
> (this is specified in web.config files in several directories in the
> web
> site), the user is redirected to the logon page. But I want the user
> to be
> redirected to an 'acces denied' page. How can that be accomplished?
> Thanks,
> Bert-Jan



 
Reply With Quote
 
 
 
 
BJ Lap
Guest
Posts: n/a
 
      11-20-2005
Thanks! This works fine now.
Bert-Jan

"Brock Allen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) .com...
> You need to check on your login page to see if Request.IsAuthenticated.
> This will tell you they've been redirected and they're already logged in.
> You can then let them know they've tried to access a page that they don't
> have access to.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>> Hi,
>>
>> I implemented forms authentication in my web site.
>> This works fine but for one thing:
>> If an authenticated user tries to navigate to a page for which this
>> user has
>> no access,
>> (this is specified in web.config files in several directories in the
>> web
>> site), the user is redirected to the logon page. But I want the user
>> to be
>> redirected to an 'acces denied' page. How can that be accomplished?
>> Thanks,
>> Bert-Jan

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
401: Unauthorized. Problem calling web service from forms authenti mike ASP .Net Web Services 1 06-06-2009 07:54 PM
Redirect Unauthorized Access Evan M. ASP .Net 1 05-23-2007 08:15 PM
Forms Authentication: Redirect to Unauthorized.aspx in subdirectories? Diane Y ASP .Net Security 1 03-28-2006 07:18 PM
forms authentication -- expired forms cookie vs. not provided forms cookie Eric ASP .Net Security 2 01-27-2006 10:09 PM
Basic Q - Response.Redirect, all redirect to first Response.Redirect statement Sal ASP .Net Web Controls 1 05-15-2004 03:46 PM



Advertisments