ToString1
asked on
Implement custom membership provider with MVC2 sql server
I want to implement a custom membership provider and have 3 database  tables
User
UserID, name, RoleID
Role
RoleID, roleName
UserRoleManyToMany
UserID, RoleID
I don't really want a link to another site but just an oviewview of how to implement please
User
UserID, name, RoleID
Role
RoleID, roleName
UserRoleManyToMany
UserID, RoleID
I don't really want a link to another site but just an oviewview of how to implement please
ASKER
OK thanks
Could you give a quick snippet of stubbing out methods and say just implementing ValidateUser() method?
Could you give a quick snippet of stubbing out methods and say just implementing ValidateUser() method?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Otherwise, the best place to start is the sample implementation from MSDN.
http://msdn.microsoft.com/en-us/library/44w5aswa.aspx
Essentially, you need to implement MembershipProvider. You can stub out many of the methods, but must implement the ValidateUser() method, and Initialize() methods. If you are trying to leverage the IIS Membership management gui, then you will need to implement more to allow password resets, lockout management, etc. All of these basically are low level data access layer boilerplate code to fetch / update / store user records from your tables.
Implement the interface by creating your custom class as show in the sample code, configure your web.config (also shown in the sample) then go from there, and ask back here for more specific answers.