0

I've been Googling terms like

configure database for mvc authentication

But I can't find anything from this decade that relates to my configuration.

I've created an MVC application using .NET Framework 4.6 with authentication support (database first). Now where do I find step-by-step instructions for creating the database tables and configuring MVC to use them?

Thanks for any tips!

2
  • You can start here: asp.net/identity/overview/getting-started/… Commented Feb 2, 2017 at 2:12
  • @trailmax: Thanks, been reading there now. Too bad some of the articles are so old though. And the only example I've found so far assumes you are using Azure. Commented Feb 2, 2017 at 17:27

1 Answer 1

1

The correct thing to google for is 'ASP.NET Identity'.

If you generate an MVC app straight from one of the templates it will generate a number of classes to handle security and identity.

One of these classes will implement interface IUserStore. The class provided will inherit from Microsoft.AspNet.Identity.EntityFramework.UserStore<TUser>, and uses Entity Framework to check the database if the tables exist, and create them if they are not there.

If you are uneasy about giving your application enough privileges to modify your data schema (ew!), you can create your own class that implements IUserStore and plug that into the system.

It's a big topic, but hopefully this is enough to get started with.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.