Using two login pages in forms authentification?

G

Guest

Hello, following problem:

I have set two folders in the web.config file, that should be protected
against anonymous users. I am using forms authentification. Is there a way to
use two login pages? If a not authentificated user wants to access secured
folder1, he should be redirect to the page login1.aspx, but, if an anonymous
user wants to access folder2, he should be redirect to login2.aspx.

Is such a configuration possible? How to make such a rule in web.config?

I am using .net 1.1
 
M

mortb

I think that the two folders may have their own web.config files which will
make it possible to set different authentication behvaiours for each of the
two.

hope this helps!

mortb

"the friendly display name"
 
J

Joey

Check up on Roles in FormsAuthentication. You can plant code in the
HttpAuthenticateRequest() function in Global.asax that will insert user
roles (gained from DB or web.config) into the HttpContext. After that,
in your web.config <location> tags, just assign the different roles as
"allowed" and then denied="*" afterwards. All it takes then is a call
in your code behind....

if(HttpContext.User.IsInRole("Administrator")
{
somecode;
}

I know this way works in both VS2003 and VS2005. I also know that the
user/role mangement stuff is built right in to VS2005...but I haven't
tried it yet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top