Re: Setting Roles with Forms Authentication and Access 2003
From: John Saunders (johnwsaundersiii_at_notcoldmail.com)
Date: 06/04/04
- Next message: - Steve -: "Re: Forms Authentication and Active Directory"
- Previous message: Mike: "Cookies"
- In reply to: Ed: "Setting Roles with Forms Authentication and Access 2003"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 4 Jun 2004 17:27:05 -0400
"Ed" <anonymous@discussions.microsoft.com> wrote in message
news:261F3A6E-C4A1-4318-A38B-C2C34B6ADFFA@microsoft.com...
> Hi,
>
> I currently have an asp.NET project. I'm using Access 2003 and forms
authentication to authenticate users. Can anyone tell me how to set the
roles in asp.NET so that it recognizes them? The logging in portion of my
code works...What I need to know is how to allow access to certain pages to
users with an administrator role while blocking access to regular users. My
database has 3 columns, username, password, and roles. It is the last
column that I would like asp.NET to recognize.
The standard way to do this is to get a list of roles out of your database,
however you would do that. You will then save the list (perhaps as
comma-separated values) in the UserData property of the Forms Authentication
ticket. Then, in the AuthenticateRequest handler in global.asax, you'll pull
the list out of UserData and supply it to the GenericPrincipal constructor.
See HOW TO: Implement Role-Based Security with Forms-Based Authentication in
Your ASP.NET Application by Using Visual Basic .NET
(http://support.microsoft.com/default.aspx?scid=kb;en-us;306238) for an
example.
-- John Saunders johnwsaundersiii at hotmail
- Next message: - Steve -: "Re: Forms Authentication and Active Directory"
- Previous message: Mike: "Cookies"
- In reply to: Ed: "Setting Roles with Forms Authentication and Access 2003"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|