SimpleMembership to Replace ASP.NET Membership Provider

If you have ASP.NET 4.5 installed and new up a new ASP.NET MVC 4 project in Visual Studio, or if you are in Visual Studio 2012, you will see that the AccountController implementation is different than previous version (see this post).

Well, ASP.NET 4.5 comes with new membership provider called SimpleMembership. Among other features, what I like the most about this is its support on OAuth like Facebook, Twitter or Google accounts. In addition to that, you can know define your own User table in database and SimpleMembership will just integrate itself to your table, providing that the User table has UserID and UserName column.

SimpleMembership allows easy integration with social media sites like Facebook or Twitter, particularly ‘log-in-with-Facebook’ feature. As a matter of fact, this feature comes out of the box when you new up ASP.NET MVC 4 project in Visual Studio.

Jon Galloway has the complete coverage on SimpleMembership here: SimpleMembership

And here’s the step to add login-with feature on your new MVC 4 project: OAuth Support for WebForms and MVC

ASP.NET Universal Providers Membership

Previously, there are more tables created in database when you install ASP.NET Membership. The tables are (vary depend on features you install):


Detail instruction to install ASP.NET Membership can be found here.

New ASP.NET Universal Provider Membership offer much simpler membership schema in ASP.NET. There are only 6 tables:


As you can see, the name is also simplified.

Read more about the post here:

Introducing System.Web.Providers
ASP.NET Membership Schema Created Automatically

Creating ASP.NET Membership in SQL (Web Forms and MVC)

ASP.NET Membership is Microsoft approach to provide security, authentication and authorization in that regards, for ASP.NET Web Forms and ASP.NET MVC. Both Web Forms and MVC can utilize this feature through Forms Authentication approach.

There are several ways to create Membership database in SQL Server.

SQL Server Registration Tool (Aspnet_regsql.exe) – Wizard

%WINDIR%\Microsoft.Net\Framework\<.net version>\aspnet_regsql.exe

Running this tool will guide you to installing ASP.NET Membership in SQL Server.
See the ASP.NET Membership Tutorial on “Installing the Application Services” section for more instruction.

SQL Server Registration Tool (Aspnet_regsql.exe) – Advanced Options

Beside the wizard guide, you can also use its command prompt with many available options.
See MSDN site for the parameters.

SqlServices.Install Method

To programatically install ASP.NET Membership, use SqlServices.Install method.

SQL Scripts Manual Approach (for Deployment Plan)

Generate sql script with SQL Server Registration Tool (Aspnet_reqsql.exe) to include them in a database project as part of deployment strategy.

%WINDIR%\Microsoft.Net\Framework\<.net version>\aspnet_regsql.exe -sqlexportonly <filename.sql> -A all

SQL Scripts Manual Approach (for Deployment Plan) – Individual Scripts

In the following folder, you will find many .sql script files to install / uninstall ASP.NET Membership. Each service (or feature – Membership, Roles, Profile, Web Parts Personalization, Web Events) is separated by files. This also can be included in a database project as part of deployment strategy.

%WINDIR%\Microsoft.Net\Framework\<.net version>\

ASP.NET Membership Schema Diagram