Groups > Asp .Net > ASP dotNET Security > Re: Manually using roles for users?




Manually using roles for users?

Manually using roles for users?
Wed, 2 Apr 2008 18:59:25 +0000
I have different pages I want different users to have access to. Right now I am
using forms authentication with manual checking of user credentials against an
access database. After I check against the access database to see if their
username and password are ok I use: 


FormsAuthentication.SetAuthCookie(login.UserName, false);
Response.Redirect("menu.aspx");

 
I was looking at a lot of other forum posts and using roles to restrict access
to certain pages etc, but I don't know how to work it into my flow because I am
not using a SQL server for authentication, so how would I go about using roles
and where how would I assign them? Would I store them in my access database? I
need a walk through on how to use them in my scenario or if I'm even able to use
them. 

 Also, if there is a better and/or easier way to restrict certain users from
certain pages, please do share. Thanks in advance.
Post Reply
Re: Manually using roles for users?
Wed, 2 Apr 2008 23:12:13 +0000
I am in the middle of a project that needed to implement roles and is not using
a SQL server backend as well.... it is actually using a web service the customer
manages to handle authentication.  The best way I found to implement this was
using .NET's Membership and Role providers.  You can extend the .NET
MembershipProvder and RoleProvider classes, and provide your custom methods that
interact with your access database.  You can then use the .NET Login controls
that are wired to interact with these classes.

Here are some links I used when I was first getting up to speed on these provder
classes.


 Managing User By membership:
http://msdn2.microsoft.com/en-us/library/tw292whz(VS.80).aspx

 Managing Authorization Using ASP.NET Roles: 
http://msdn2.microsoft.com/en-us/library/53s18z5c(VS.80).aspx
Post Reply
Re: Manually using roles for users?
Thu, 3 Apr 2008 22:34:12 +0000
That's not exactly what I was getting at, but I found a site that did exactly
what I wanted to do. Thanks for your help anyways :D

 Here's the link to the site that helped out, if anyone else is interested:
http://microsoft.apress.com/asptodayarchive/72047/forms-authentication-and-role-
based-security-in-aspnet
Post Reply
about | contact