Saturday, February 8, 2014

Using custom roles with ASP.Net Identity v2-alpha

When creating a new ASP.Net MVC 5 site we are given the option to choose the type of authentication we want for the site. If we choose "Individual accounts" the site is configured to use forms authentication with an Entity Framework backend. This backed uses ASP.Net Identity, which is the replacement for ASP.NEt Membership. In a test project I have, I decided I wanted to use the pre-release version of ASP.Net Identity, which, at the moment, is version 2-alpha. To upgrade to this version, we only have to upgrade the package from Nuget. We open the Nuget package manager and we select we want packages from the pre-release channel. Then we can update to the pre-release packages.