CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 7/10/2007 1:43:12 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 10 Views: 18 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
11 Items, 1 Pages 1 |< << Go >> >|
kalahaine
Asp.Net User
Redirecting users after they've been denied an access7/10/2007 1:43:12 PM

0/0

Hello EveryBody,

 

i'm working on the security part of a webiste. This site contains 11 roles, and the access rules are well defined. I've created them and this works as i expected it to work BUT

(won't have been here if there was no "but")

can give me a tip on how to redirect the users that have been denied an access to some pages in another page than the login page.

Everytime an access is refused, i'm sent back to my login form but would prefer to be sent to the index of the site.

 

THANKS A LOT 

netvir
Asp.Net User
Re: Redirecting users after they've been denied an access7/10/2007 2:00:02 PM

0/0

If you are using the ASP.NET menus or sitemap,  you could use

securityTrimmingEnabled="true"

in your web.config file so you won't even have that problem as the users who don't have access to that page won't even see that it exists as it wont be listed on the menu.

 

<
siteMap defaultProvider="default">

<providers>

<add name="default" type="System.Web.XmlSiteMapProvider"

siteMapFile="Web.sitemap" securityTrimmingEnabled="true"/>

</providers>

</siteMap>

 

ecbruck
Asp.Net User
Re: Redirecting users after they've been denied an access7/10/2007 2:01:36 PM

0/0

If you want to change the url for which non-authenticated users are redirected, then you should change the loginUrl property of the forms element within your Web.config file.

http://msdn2.microsoft.com/en-us/library/1d3t3c61.aspx


Thanks, Ed

Microsoft MVP - ASP/ASP.NET

Please remember to 'Mark as Answer' if this post answered your question!
netvir
Asp.Net User
Re: Redirecting users after they've been denied an access7/10/2007 2:07:47 PM

0/0

you could do that as well but when ppl try to access a page that they normally have access to won't be able to access it and instead of being re-directed to your login form, they'll just be redirected to your home page.

 But whatever works for you.

kalahaine
Asp.Net User
Re: Redirecting users after they've been denied an access7/10/2007 2:21:11 PM

0/0

 Thanx for your help.

 

1st: I use a sitemap, bit I have got a css menu and have to keep it where it is, so i've given up the solution of the asp.net controls.

2nd : I didn't remember the loginUrl

3rd: I would like to use it but always get an error

 

Line 20 :   <roleManager enabled="true" />
Line 21 :     <authentication mode="Forms">
Line 22 :       <Forms loginUrl="~/Accueil.aspx">
Line 23 :       </Forms>
Line 24 :     </authentication>

 what shall i modify ?

 

THX A LOT FOR YOUR HELP
 

pbromberg
Asp.Net User
Re: Redirecting users after they've been denied an access7/10/2007 2:22:52 PM

0/0

why not just put a login form (a small one) on your main page? That's what most sites do.


[C# MVP]
Unblog|WebSite|IttyUrl|BlogMetafinder
ecbruck
Asp.Net User
Re: Redirecting users after they've been denied an access7/10/2007 2:27:00 PM

0/0

The elements and attributes within your Web.config file are case-sensitive. With this, change your 'Forms' element to 'forms'.


Thanks, Ed

Microsoft MVP - ASP/ASP.NET

Please remember to 'Mark as Answer' if this post answered your question!
kalahaine
Asp.Net User
Re: Redirecting users after they've been denied an access7/10/2007 2:29:10 PM

0/0

 I can really not do it since I am not the project manager, since I just can type lines of code, just giving my opinion on the gestion rules and way to proceed, but not on the organisation of the site and its graphic aspects... ;)

 Actually, i've got a specific login page because i need to explain many things to my users before giving them the possibility to log in or to create an account. Moreover, this is some kind of transition page from an internet website to an intranet site.

 

Thx
 

kalahaine
Asp.Net User
Re: Redirecting users after they've been denied an access7/10/2007 2:54:22 PM

0/0

 @ecbruck: thx for your help, i modifed my mistake but this still do not work. In fact, it has stopped redirecting me to the login page, but it now sends me to the parent directory, listing all the pages and directories of the site.

 The page i want to be redirected to is in the root directory, it is called Accueil.aspx and i believe i don't need any "~" or "/" .
 

ecbruck
Asp.Net User
Re: Redirecting users after they've been denied an access7/10/2007 2:59:38 PM

0/0

I'm not sure why that didn't work. Your url looks fine. You're close.


Thanks, Ed

Microsoft MVP - ASP/ASP.NET

Please remember to 'Mark as Answer' if this post answered your question!
XiaoYong Dai –
Asp.Net User
Re: Redirecting users after they've been denied an access7/12/2007 6:01:00 AM

0/0

kalahaine:

This site contains 11 roles, and the access rules are well defined.

....... 

can give me a tip on how to redirect the users that have been denied an access to some pages in another page than the login page.

Hi

User will be redirect to login page so that they can re-input an account and after a successful login, it uses ReturnURL to navigate from the login page.

If you predict they don't want to re-input an account but prefer to be sent to the index of the site, I think you can use

Response.Redirect("index.html")

in Page_Load event of login page.

 


Best Regards
XiaoYong Dai
Microsoft Online Community Support

Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
11 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Access Denied: The Practice and Policy of Global Internet Filtering Authors: Ronald Deibert, John G. Palfrey, Rafal Rohozinski, Jonathan Zittrain, Pages: 449, Published: 2008
Beginning Dreamweaver MX Authors: Charles Brown, Imar Spaanjaars, Todd Marks, Pages: 816, Published: 2003
Domino System Administration: Administering Domino for Lotus Notes & the Internet Authors: Rob Kirkland, Pages: 880, Published: 1999
All-in-one MCSA Windows Server 2003: Exam Guide Authors: Brian Culp, Mike Harwood, Jason Berg, Pages: 993, Published: -1
Beginning Dreamweaver MX 2004 Authors: Charles E. Brown, Imar Spaanjaars, Todd Marks, Pages: 792, Published: 2004
Professional ASP.NET 1.0: Updated and Tested for Final Release of ASP.NET V.1.0 Authors: Richard Anderson, Alex Homer, Dave Sussman, Karli Watson, Pages: 1354, Published: 2002
Dreamweaver MX 2004 Savvy: Christian Crumlish, Lucinda Dykes Authors: Christian Crumlish, Lucinda Dykes, Pages: 670, Published: 2004
The Oracle Hacker's Handbook: Hacking and Defending Oracle Authors: David Litchfield, Pages: 190, Published: 2007
PHP Web Development with Macromedia Dreamweaver MX 2004 Authors: Allan Kent, David Powers, Rachel Andrew, Pages: 531, Published: 2004

Web:
CodeProject: Redirecting to custom 401 page when "Access denied ... NET "Access Denied 401" page. I have decided to replace this default .... I guess the users outside a role are authenticated. Tha's why they are authorized. ...
logged-in user + /user/register -> access denied | drupal.org I also tried to redirect if the user in logged in with a custom access denied page but it still doesn't work. Does anyone have a solution? ...
lighttpd forum - Blocking user agents Wouldn't the best way to do this be by using mod_redirect, and redirect all the requests to some page explaining why they have been denied access? ...
Redirect an authenitcated user from a page to which they are ... Redirect an authenitcated user from a page to which they are denied access in the Web.config. Last post 09-12-2007 10:05 AM by ngruson. 3 replies. ...
Access Denied in new user approval email (IIS 401.2 error ... Oct 7, 2008 ... Could my SSL rediect issue have been the fix in my case? .... Redirect users who are not logged in when they attempt to access the Edit ...
Display login form for anymous users when 'access denied' | Drupal ... If the user logs in, they will be redirected to the page they were ... on going about redirecting users after a successful logon from a custom access denied ...
Nukemods.com - ip range redirecting I have found this will redirect a user to a page explaining that they have been denied access to the site but as soon as they disconnect and ...
Adobe Forums - How to set KT_REFERRER session variable for login ... I've tried changing the redirect trigger on the login page to: ... the user will be redirected to the calling page after they're logged in (not the default ...
Permanently Redirect a Specific IP Request for a Single Page via ... I have been using toolator’s ip blocker for sometime now, which is basically pasting a html code onto the site. However they are now charging for there ...
Allow anoymous users to log in on access denied | drupal.org That means that we cannot redirect to the destination page after login ... However, if a user gets an access denied message, they should be ...

Videos:
Core Patterns for Web Permissions Google TechTalks July 19, 2006 Tyler Close Visiting Scientist Hewlett-Packard Laboratories Mr. Close is a researcher and developer, working in the...




Search This Site:










2 buttons, but different required fields

remote connections to sql server with godaddy

problems with sitemap and securitytrimmingenabled

embedd a website into another

sql server and treeview

i'm having trouble authenticating a user.

translation

asp.net 2.0 or sqlserver training videos

memory efficiency of datatables

security issues with a com component

how to change gridview data dynamically and on the client side?!

can i redistribute the microsoft.web.ui.webcontrols.dll with my commercial app?

global.asax

the best way to send a large number of emails

how to make some dates disable in the calendar?

problem debugging int variables in vs 2005

"no question too simple"

email

where are the assemblies ???

dnn 4.0 install package - where are all the modules?

rss news feed

onclick menu (dnn 2.0.4) insanity

redirect to error page in windows authentication

simple delegate application

install dnn on remote server: discountasp.net

html help

css not working?

can't rewrite data in datatable

another skin is available

system.web.mail - adding images

 
All Times Are GMT