User management in websites mostly required for E-Commerce, posting comments, Emails and more…
ASP.NET framework has built-it API for handling Membership, Roles and profiles.
Membership (System.Web.Security.MembershipProvider) – User accounts access and registration.
Roles (System.Web.Security.RoleProvider) – Organizing users into groups (for example: Admin, regular user, banned).
Profiles (System.Web.Profile.ProfileProvider) – Storing extra data per-user.
If you have a small size website, you can use the built-in SQL provider (SqlMembershipProvider) with SQL Server Express.
For medium/large corporate website, with regular user administration requirements, use the Active Directory Membership Provider.
If the built-in providers don’t suite you well, create a custom one of your own, by inherit the classes and override the methods with your own code.
Regarding the UI (now we’re getting to MVC), ASP.NET provides WebForms and membership controls for login/logout but you can’t use them in ASP.NET MVC.
You need to create your own MVC views for login/logout.
So what should you choose, the built-in providers or create your own providers? … Good question.
It depends on how much time you got, experience with data storage (in DB or maybe in XML files), security level and scalability of your website.
If you plan to improve and expand your website in the future, I advise you to consider building your own providers.
You will be able to fully control over security, adding extra data to users, manage large scale websites and much more!
A few related links:
Creating the Membership schema in SQL Server: http://www.asp.net/learn/security/tutorial-04-cs.aspx
Creating and managing Roles: http://www.asp.net/learn/security/tutorial-09-cs.aspx
MembershipProvider class: http://msdn.microsoft.com/en-us/library/system.web.security.membershipprovider.aspx
RoleProvider class: http://msdn.microsoft.com/en-us/library/system.web.security.roleprovider.aspx
ProfilesProvider class: http://msdn.microsoft.com/en-us/library/system.web.profile.profileprovider.aspx
ASP.NET MVC Membership Starter Kit: http://www.codeplex.com/MvcMembership