HighTechTalks DotNet Forums  

Should I use .net's membership, role systems for authentication andauthorization?

ASP.net ASP.net discussions (microsoft.public.dotnet.framework.aspnet)


Discuss Should I use .net's membership, role systems for authentication andauthorization? in the ASP.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
gnewsgroup
 
Posts: n/a

Default Should I use .net's membership, role systems for authentication andauthorization? - 12-11-2007 , 03:01 PM






I am working on a membership web application,

The logic is like this:

1. All logged-in users can visit Folder1, Folder2, Folder3, but
only administrators can access the Admin folder. Desirably, the link
to Admin pages won't even be visible to regular logged-in users.
2. For pages in Folder1, Folder2, Folder3, some pre-defined actions
(such as edit/delete) can only be done by an administrator.

I was trying to achieve logic 1 without considering 2 by creating a
web.config file underneath Admin folder, and in this web.config, I say

<system.web>
<authorization>
<allow users="admin" />
<deny users="johndoe" />
<deny users="smithdoe" />
</authorization>
</system.web>

The problem is when Johndoe tries to access the admin page, he is
kicked out right to the Login page of the application. How do I kick
him back to where he came from? Also, it's gonna be a problem if I
have to explicitly specify the allowed and denied users.

I think it is more troublesome to implement Logic 2.

I have never done anything using the asp.net membership, role, profile
framework. Will it greatly ease the implementation of the business
logic? I would like to know from the experienced before I delve into
the membership, role, profile systems. We have our own user table in
our database, which does not match the table structure of the
SqlMembership provider's user table.

Thank you very much.

Reply With Quote
  #2  
Old   
Peter Bromberg [C# MVP]
 
Posts: n/a

Default RE: Should I use .net's membership, role systems for authentication an - 12-11-2007 , 04:16 PM






For item 2, if you are going to "let them in" then you might consider using
something like
if( Page.User.IsInRole("Administrator") )
{
// your logic to enable / disable controls here
}

Yes, ASP.NET membership, roles and profiles can definitely speed up and
improve your application development. There's always a learning curve to get
to first base, but it's worth it.
--Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com


"gnewsgroup" wrote:

Quote:
I am working on a membership web application,

The logic is like this:

1. All logged-in users can visit Folder1, Folder2, Folder3, but
only administrators can access the Admin folder. Desirably, the link
to Admin pages won't even be visible to regular logged-in users.
2. For pages in Folder1, Folder2, Folder3, some pre-defined actions
(such as edit/delete) can only be done by an administrator.

I was trying to achieve logic 1 without considering 2 by creating a
web.config file underneath Admin folder, and in this web.config, I say

system.web
authorization
allow users="admin" /
deny users="johndoe" /
deny users="smithdoe" /
/authorization
/system.web

The problem is when Johndoe tries to access the admin page, he is
kicked out right to the Login page of the application. How do I kick
him back to where he came from? Also, it's gonna be a problem if I
have to explicitly specify the allowed and denied users.

I think it is more troublesome to implement Logic 2.

I have never done anything using the asp.net membership, role, profile
framework. Will it greatly ease the implementation of the business
logic? I would like to know from the experienced before I delve into
the membership, role, profile systems. We have our own user table in
our database, which does not match the table structure of the
SqlMembership provider's user table.

Thank you very much.


Reply With Quote
  #3  
Old   
gnewsgroup
 
Posts: n/a

Default Re: Should I use .net's membership, role systems for authenticationan - 12-12-2007 , 08:19 AM



On Dec 11, 4:16 pm, Peter Bromberg [C# MVP]
<pbromb... (AT) yahoo (DOT) NoSpamMaam.com> wrote:
Quote:
For item 2, if you are going to "let them in" then you might consider using
something like
if( Page.User.IsInRole("Administrator") )
{
// your logic to enable / disable controls here

}

Yes, ASP.NET membership, roles and profiles can definitely speed up and
improve your application development. There's always a learning curve to get
to first base, but it's worth it.
--Peter
Site:http://www.eggheadcafe.com
UnBlog:http://petesbloggerama.blogspot.com
MetaFinder:http://www.blogmetafinder.com

Thank you very much. Then I guess the .net membership and role is the
way to go. Gotta look into it.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.