Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I use my own database with SimpleMembership and WebSecurity? What is MVC4 security all about?
    primarykey
    data
    text
    <p>I've read everything on this topic I could find, including MSDN articles and SO posts, but I'm still very lost and confused.</p> <h2>Questions</h2> <p>Please answer the following (briefly, if possible):</p> <ol> <li><p>What is <strong>SimpleMembership/SimpleMembershipProvider</strong> (<em>WebMatrix.WebData</em>) and what is it/are they responsible for?</p></li> <li><p>What is <strong>WebSecurity</strong> (<em>WebMatrix.WebData</em>)?</p></li> <li><p>What is the <strong>Membership</strong> (<em>System.Web.Security</em>) class?</p></li> <li><p>Why does MVC4 create a <strong>UserProfile</strong> table and a <strong>webpages_Membership</strong> table? What are they for and what is the difference? What is the UserProfile class that MVC4 creates?</p></li> <li><p>What is the <strong>UsersContext</strong> class?</p></li> <li><p>How do all of these work together to make user authentication?</p></li> </ol> <h2>My Situation</h2> <p>These questions then lead into the next problem:</p> <p>Suppose I have an existing database with users (IDs, Usernames, passwords). I'm creating a new MVC4 application and using Forms Authentication. User passwords are stored in the database in an encrypted form (not bcrypt).</p> <p>What do I have to do to make it work with MVC4?</p> <p>Do I have to create a custom <em>MembershipProvider</em>?</p> <h2>My Knowledge Thus Far</h2> <p>As far as I can understand, <em>WebSecurity</em> is a static class (Module) that interacts with a <em>MembershipProvider</em>. A MembershipProvider is a class that explains how particular functions work, such as <em>ValidateUser</em>, <em>CreateUser</em>, <em>ChangePassword</em>.</p> <p>To solve my problem I assume I need to create a custom MembershipProvider and tell WebSecurity to use my new MembershipProvider.</p> <h2>Bounty?</h2> <p>I have placed a bounty on this question and intend to award it to Andy Brown for an outstanding answer.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload