G
Guest
I have been having some trouble with implementing a custom Membership
Provider. We have a custom data store and business logic that pulls user
information. I need some level of functionality above and beyond what the
prodiver currently allows. I need the ability to access a user id and the
user's permission id. With Forms authentication in 1.1, I would just create
a custom identiy and principal and store the information in the identity.
However, the membership provider doesn't quite support this. I can get the
login conrols to work properly with my custom membership provider, I just
can't find a way to expose more information about a user from my custom
classes. I've looked at the profile provider; I haven't had success with
that either. That doesn't seem to want to store information in an
authentication ticket like the membership provider does. Ideally I would
like everything stored in the authentication ticket (as it is with the
membership provider). I don't want to have to go to the database everytime
the page loads just to get the user id.
Sooooo...my basic requirements are as follows.
1. Use asp.net Login Controls
2. On any page, at any time, I want to know the current logged in user's id
3. On any page, at any time, I want to know the current user's permission id
So, I just want to retrieve two integer values on top of what the membership
provider gets me. I would like to avoid implementing the profile and role
provider because i feel it would be overkill. Also, I don't want to do
authentication via the session, or manually via cookies. I would like to
leverage the provider model, but I can't get it to do exactly what I need.
Can anyone help me expose this additional information without going to the
database everytime? Thanks
Provider. We have a custom data store and business logic that pulls user
information. I need some level of functionality above and beyond what the
prodiver currently allows. I need the ability to access a user id and the
user's permission id. With Forms authentication in 1.1, I would just create
a custom identiy and principal and store the information in the identity.
However, the membership provider doesn't quite support this. I can get the
login conrols to work properly with my custom membership provider, I just
can't find a way to expose more information about a user from my custom
classes. I've looked at the profile provider; I haven't had success with
that either. That doesn't seem to want to store information in an
authentication ticket like the membership provider does. Ideally I would
like everything stored in the authentication ticket (as it is with the
membership provider). I don't want to have to go to the database everytime
the page loads just to get the user id.
Sooooo...my basic requirements are as follows.
1. Use asp.net Login Controls
2. On any page, at any time, I want to know the current logged in user's id
3. On any page, at any time, I want to know the current user's permission id
So, I just want to retrieve two integer values on top of what the membership
provider gets me. I would like to avoid implementing the profile and role
provider because i feel it would be overkill. Also, I don't want to do
authentication via the session, or manually via cookies. I would like to
leverage the provider model, but I can't get it to do exactly what I need.
Can anyone help me expose this additional information without going to the
database everytime? Thanks