Convert Existing Application from using sqlmembership to simplemembership - c#

I have been scouring the internet trying to find a solution to this problem. I have altered the role and membership providers to use SimpleMembership, but it is still referencing the old ("aspnet_XXX") tables. I have found this solution, but it seems like it is only dealing with the user data and moving it over to the new tables. Maybe I'm just reading it wrong. Anyone have any advise on the matter?

If you haven't gone deep, I would to suggest to convert to new ASP.Net Identity comes with MVC 5.
Microsoft has replaced SimpleMembership with ASP.Net Identity.
Introducing ASP.NET Identity – A membership system for ASP.NET applications
Forms authentication using ASP.NET Identity & VS 2013 Preview

Related

Microsoft Identity how to update database to new table design

I have a webforms application written in asp.net v4.7 that uses Microsoft Identity which it created the relevant tables on our SQL Server.
We are now using Razor Pages with .NET Core for all new applications. I've created a new Razor Pages application and need to use Microsoft Identity once again with the same tables as the other applications. I've created the identity part but it comes up with an error that certain columns are missing from the tables on the SQL Server when I try to login.
I've tried using PM and doing an update-database but it comes up with an error saying the tables already exist. How do I update these tables to include the new columns that the latest Microsoft Identity needs please?
Many thanks
As far as I know, the asp.net core default identity table structure is not as same as asp.net's so there is no way to directly use the old table's data.
If you want to migrate from the asp.net to asp.net core identity, I suggest you could refer to this article.

How to use a new SQL Server database for ASP.NET MVC default web application

First of all a similar question was asked on below link but since there is no satisfied and accepted answer I am asking again.
asp.net mvc modify default authentication system
When I create a default ASP.NET MVC application in Visual Studio 2015, there is a default authentication system. It has also a database with tables. What I want to do is using my own database for the default authentication system, so I can integrate it to an application easily. I can create same tables in my database for it.
I tried to find some references to tables like AspNetUsers in the code but I couldn't find anything.
I always created database first and create model from it automatically in ASP.NET MVC. So always there is reference for my tables in my code. But default ASP.NET MVC application seems different.
Which part of the code I should modify and how?
And also why couldn't I find any reference to tables in the code?
The tables are created by default when creating the project because of authentication.
If changed like this This table can not be created.
If you want to use authentication, you can use Asp.net Identity.

How to migrate ASP.NET Web Forms application from Membership to ASP.NET Identity 2.0?

I have an application which is in .NET Framework version 4.5. It uses Web Forms and EntityFramework 6.1.1.
The EntityFramework's Context object is of type ObjectContext. I'm using ASP.NET Membership(the MembershipProvider is customized i.e Custom Membership) for managing the user account related operations.
I want to migrate my Web Forms application to ASP.NET Identity.
According to http://www.asp.net/identity/overview/migrations/migrating-an-existing-website-from-sql-membership-to-aspnet-identity article I think I have to do the following things to migrate to the ASP.NET Identity:
Convert the ObjectContext to DbContext(and correct the related codes)
Create the new tables needed for ASP.NET Identity and do the data migration.
Redefine the account section codes and other dependent codes as needed to match the business logic.(optional)
I have few questions in my mind:
1) I have customized the membership User table and there are several custom foreign keys associated with the User table. Will it still be feasible to migrate to the Identity system without losing any data?
2) As I'm using EntityFramework so DbContext is needed to migrate to Identity system. Can I use ObjectContext for ASP.NET Identity migration?
3) I'm NOT using all the Membership tables as listed at http://i1.asp.net/media/48109/image006.png?cdn_id=2014-11-11-001. (i.e aspnet_Applications, aspnet_Membership, aspnet_Paths, aspnet_PersonalizationAllUsers, aspnet_PersonlizationPerUser, aspnet_Profile, aspnet_Roles, aspnet_SchemaVersions, aspnet_Users, aspnet_UsersInRoles, aspnet_WebEvent_Events)
But I am using Application, User, Role, UserInRole, Profile tables only. Can I still migrate these table in order to use the ASP.NET Identity?
I'm ready to provide more information you may need to understand my current scenario.
I'm looking for the correct steps to migrate to Identity, any caution I need to take care, any hurdles I will face? Any help is highly appreciated.
Dave Paquette wrote this http://www.davepaquette.com/archive/2013/12/30/so-you-inherited-an-asp-net-web-forms-application.aspx
This may be the answer to your problem. Once you have integrated your Web Forms project to MVC, there are plenty of guides online to integrate the new Identity 2.0.

Asp.Net MVC 5 Identity Create Database Admin Interface

I'm working on a new asp.net mvc 5 app for a small company and am trying to figure out how to create the membership database using the new asp.net Identity system. I thought there might be an admin interface I can use which would create the database and allow me to add a few users/roles. Is there an admin interface for this task or another way I will need to accomplish it? Are there any tutorials on doing something like this? All I have been able to find so far has dealt with external logins using other providers such as Facebook or Google.
I'm pretty sure that it's based off of Entity Framework Code First. When you create the db context, it should create the table for you automatically.
http://msdn.microsoft.com/en-us/data/jj193542.aspx
MVC 5 Template with VS2013 use ASP.NET Identity instead of membership provider and has no admin interface. After creating a new MVC5 project in VS2013, run the website. Once you register the first user on the web interface a local database will be created under the App_Data folder. You could rename the connection string to point to other database and register user again to create the database. To add users you could enable migration and use the seed method.
Scott Allen published a great video which might help you to understand ASP.NET Identity more
http://pluralsight.com/training/courses/TableOfContents?courseName=aspdotnet-mvc5-fundamentals&highlight=scott-allen_aspdotnet-mvc5-fundamentals-m2-katana*8#aspdotnet-mvc5-fundamentals-m2-katana

Authentication and role authorization in ASP.NET MVC 4

I'm new to ASP.NET MVC 4 framework, before I developed .NET web apps using ASP.NET Web Forms.
In my new project (I'm updating an existing Web Form project) I need to implement Form authentication and role based authorization to pages and functionalities.
Following some articles and StackOverflow answers I'm trying to use SimpleMembershipProvider but I'm finding several difficulties to configure it and in integration with my existing DB.
In particular cannot use my existing user accounts table...
I'm using SQL Server 2005 and now I'm upgrading from Linq-to-SQL to EntityFramework.
Can you suggest me the best way to implement authentication and role authorization in ASP.NET MVC4?
It depends how custom you need:
1) Try something, that exists already. As long as you're using EF, you may try https://efmembership.codeplex.com. Haven't tried it, but from first look, looks reasonable and configurable. There are also other MembershipProvider implementations on nuget gallery if previous one does not fit.
2) If really nothing fits into your scenario from existing in nuget gallery, implement membership provider by your self. Example may be here: http://blog.ianchivers.com/2012/03/entity-framework-custom-membership.html or there even video how to do it: http://www.asp.net/web-forms/videos/how-do-i/how-do-i-create-a-custom-membership-provider

Categories