How to tie SqlRoleProvider to "My" user table
How to tie SqlRoleProvider to "My" user table
I am using asp.net MVC and SqlRoleProvider appears to work out of the box. However I have my own users and roles. I have a user table the has all the user/personalized data. How do I tie the account controller back to my table. My table has a userID and I use that to tie other actions to a particular user.
Wou开发者_StackOverflow社区ld be great if I could use the account controller and after the user logs in, I have their ID.
I have been looking at this but is not quite the same as asp.net mvc
https://web.archive.org/web/20210417083524/https://www.4guysfromrolla.com/articles/121405-1.aspx
Not sure if this is the same in asp.net mvc, but we use the SqlMembership
provider for authentication with gives us back a MembershipUser
object. The MembershipUser
instance has a ProviderUserKey
property which we map to our own user table's MemberId field (which is different to our internal UserId).
精彩评论