Re: GenericPrincipal



Of course you have to execute some code on every request. The web is a
stateless protocol. As to whether you need to go all the way back to the
data store on each request to get your role data, that depends a great deal
on your implementation. You should probably be able to cache that data
somewhere.

There are a variety implementations of this type of thing built into .NET
(forms authentication, membership provider framework, etc.). Why are you
reinventing the wheel?

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Erick" <josefszeliga@xxxxxxxxxxx> wrote in message
news:1189316637.225797.29700@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm trying to create a use a genericprincipal object with roles
authorization to use in my asp.net apps

My user directs new users to an asp.net login page.
They log in and I use that ifnormation to create a genericidentity.
Then i get their roles from the data store and use that and the
generic identity to create a genericprincipal object.

I then assign the genericprincipal object to the
My.User.CurrentPrincipal.
It all works fine up to this piont

The problem occurs when I navigate to a new page.
I lose the generic identity and all the roles.
Surely I don't need to go to the datastore each time i navigate to a
new page ?
Why aren't all my values of the GenericPrincipal which i attached in
My.user.Currentprincipal
saved for the user's ENTIRE SESSION ?

Thanks
Erick



.