Role Based Forms Authentication in ASP.NET 2.0
page 1 of 16
Published: 01 Apr 2008
Abstract
Using Role based forms authentication, we can restrict users of the site to accessing certain resource if they are not part of a particular role. In this article, Satheesh demonstrates how to build sites with this type of authentication. He provides a short overview of various Login Controls and Providers and then discusses a scenario with detailed explanation of various aspects of the sample application with screenshots and source code.
by Satheesh Babu
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 65723/ 85

Introduction

Any ASP.NET site we develop will always have an authentication module unless and until there is nothing private on the site or something we explicitly know as being unnecessary. For instance, a simple public content site will not require an authentication module. Depending on the nature of the application we can decide on the type of authentication we are going to provide for our site. Meaning, if it is going to be an intranet web application, we can very well utilize the windows authentication by making use of the availability of user information in the AD, thus preventing a separate user information storage private to our application. Still, role mapping to the users has to be stored privately for the application. If our application is an internet application then the best choice is to use Forms Authentication. This article will explore the implementation forms authentication with roles in ASP.NET 2.0.

From 1.x days, the implementation of forms authentication in ASP.NET is not that complicated. But the actual drawbacks are in those days ASP.NET itself does not have that many controls that aid in implementing forms authentication easily. Also, if we have role based forms authentication then we should go for our custom code for validating a resource access. With the introduction of 2.0 we have a handful of controls that help in implementing role based forms authentication very easily with the primary support of Providers in ASP.NET 2.0.


View Entire Article

User Comments

Title: it works at once   
Name: snopbear
Date: 2008-08-26 9:32:07 AM
Comment:
When I log in with test1 or any of them, I get redirected to a HTTP Error 404 - Not Found page. Any ideas?
Title: Question   
Name: Jeff
Date: 2008-06-26 9:53:38 AM
Comment:
When you log into the site with a user, go to their homepage, then click logout, hit the BACK button enough, it will get you into the home page without credentials.

Once you hit refresh it kicks you out and you have to login again.

This happens in IE6. It seems to work in Firefox right.
Title: Something is wrong   
Name: Mike
Date: 2008-06-25 10:16:43 AM
Comment:
When I log in with test1 or any of them, I get redirected to a HTTP Error 404 - Not Found page. Any ideas?
Title: permissions and roles   
Name: tariq
Date: 2008-05-12 5:39:03 AM
Comment:
Hi,

I need to grant users with permissions depending on their roles. I have heard about Visual Guard .Net http://www.visual-guard.com/EN. before I start testing, do you have any feedback about this tool?

thank you
Title: Thnx   
Name: Dhaval Patel
Date: 2008-05-02 11:04:11 AM
Comment:
thanks buddy... it helped understanding it better.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 4:49:34 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search