473,386 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Forms authentication: how to redirect unauthorized users?

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
Nov 20 '05 #1
2 2940
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

Nov 20 '05 #2
Thanks! This works fine now.
Bert-Jan

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:b8**************************@msnews.microsoft .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


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stu | last post by:
Hi All, I have an ASP.NET application to which I have implemented forms authentication to handle security. It is a relatively straight forward solution with all aspx pages residing in the root...
11
by: ElmoWatson | last post by:
I tried on the Security newgroup, as well as other places, and haven't gotten an answer yet - - I'm pulling my hair out over this one. I'm trying to get Forms Authentication working.....I can get...
3
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
5
by: Gavin Stevens | last post by:
I'm trying to figure out the ASP.NET Forms Auth I have 3 or 4 pages i want to allow anonymous access to.. Then I have 5 or 6 pages I placed in another directory in the webproject. These I want...
2
by: Dan | last post by:
hi ng, i have a problem with windows authentification. i want to forward every user who 1. is not authorized 2. or could not be authenticated to a login page -------------------
4
by: WebBuilder451 | last post by:
I have an app that will direct to the login on any unauthorized access. It will redirect back to the calling page when authenticated. Now here is the problem. I'm allowing for user registration...
2
by: Wiktor Zychla [C# MVP] | last post by:
Hi, I struggle for over an hour with the integrated Cassini web server. the problem I am facing is as follows: when I turn forms authentication on in the web.config file, the website seems to...
1
by: n33470 | last post by:
Hi all, We have an asp.net 1.1 app that we're in the process of converting to 2.0. What I'm about to describe runs just great in the 1.1 framework, but does not work in the 2.0 framework. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.