Custom Membership Provider
Custom Membership Provider is easy to do. Firstly, please extends MembershipProvider
Code
public class AdvCMSMembershipProvider : MembershipProvider |
Secondly, Right Click MembershipProvider, and then implements all abstract methods.
The only method you need to change:
Code
public override bool ValidateUser(string username, string password) | |
{ | |
IAdvUser user = userRepository.GetByUserName(username); | |
| |
return user.Password == password; | |
} |
Lastly, chaging web.config
Code
<membership defaultProvider="AdvCMSMembershipProvider"> | |
<providers> | |
<clear/> | |
<add name="AdvCMSMembershipProvider" | |
type="AdvCMS.Security.AdvCMSMembershipProvider, AdvCMS.Security" /> | |
</providers> | |
</membership> |
Please download our opensource project, AdvGenCMS, as the example.
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 125 feedbacks awaiting moderation...
Form is loading...