Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Conditional forms authentication

Reply
Thread Tools

Conditional forms authentication

 
 
ajitgoel@gmail.com
Guest
Posts: n/a
 
      04-04-2007
Hi;

I am using forms authentication for some new aspx screens in our site.
These pages need to be not accessible to users who do not have certain
rights while they need to be accessible to users who have these
rights. These rights would be determined at runtime and would come
from a webservice. Basically this is what I want to do

User has rights and user clicks on a page section that requires
logging in,
=>redirect user to login page
=>User logs in and the system redirects him to the originally
requested page section.

User does not have rights and user clicks on a page section that
requires logging in,
=>the system redirects him to the originally requested page section.

Also these new pages cannot be accessible to users who do not have the
appropriate rights.

Where would I write code to handle this "if else" case?? Would the
Page_PreInit method of the login page, be a good place or should I do
it in the global.asax's FormsAuthentication_OnAuthenticate event?? Is
it possible declaratively (in web.config possibily)?? I would not like
to make changes to the old screens as they are too huge in number and
would need to be retested for all scenarious.

Pointers\comments are higly appreciated.

Thanks,
Ajit Goel

 
Reply With Quote
 
 
 
 
David
Guest
Posts: n/a
 
      04-04-2007
Most of the examples of FormsAuthentication show you to create a folder and
secure that folder by your web.config, so that any pages in that folder that
are requested will result in the loginpage (also defined in web.config) to
be shown.

If a person has no access, then they don't get access to your pages.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
<> wrote in message
news: ups.com...
> Hi;
>
> I am using forms authentication for some new aspx screens in our site.
> These pages need to be not accessible to users who do not have certain
> rights while they need to be accessible to users who have these
> rights. These rights would be determined at runtime and would come
> from a webservice. Basically this is what I want to do
>
> User has rights and user clicks on a page section that requires
> logging in,
> =>redirect user to login page
> =>User logs in and the system redirects him to the originally
> requested page section.
>
> User does not have rights and user clicks on a page section that
> requires logging in,
> =>the system redirects him to the originally requested page section.
>
> Also these new pages cannot be accessible to users who do not have the
> appropriate rights.
>
> Where would I write code to handle this "if else" case?? Would the
> Page_PreInit method of the login page, be a good place or should I do
> it in the global.asax's FormsAuthentication_OnAuthenticate event?? Is
> it possible declaratively (in web.config possibily)?? I would not like
> to make changes to the old screens as they are too huge in number and
> would need to be retested for all scenarious.
>
> Pointers\comments are higly appreciated.
>
> Thanks,
> Ajit Goel
>



 
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
Best practices for using forms authentication and security in a hosted env (was: Re: Using a Forms authentication in a shared hosting environment) JEFF ASP .Net 1 11-12-2007 07:00 PM
forms authentication -- expired forms cookie vs. not provided forms cookie Eric ASP .Net Security 2 01-27-2006 10:09 PM
Forms authentication - Multiple login forms based on directory acc Keltex ASP .Net Security 1 01-24-2006 03:06 PM
? ELSE Conditional Comment / Using Conditional Comments Inside Other Tags To Comment Out Attributes Alec S. HTML 10 04-16-2005 02:21 AM
Forms Authentication question: How to have some pages open and some requiring forms authentication Eric ASP .Net 2 02-13-2004 02:14 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57