0

I used the WSAT to configure security, but the users I create with it are not being flowed through to the ASP.Net Membership that comes with the stock MVC template (they cannot log in to the site). Conversely, the users that I am registering via the MVC registration screen are not showing up in the WSAT Manage Users form.

I would like to create a few roles, but I am unsure how I put the users created with the MVC registration screen into the roles created with the WSAT since those two pieces don't appear to be communicating.

Daniele
  • 1,938
  • 16
  • 24
Mister Epic
  • 16,295
  • 13
  • 76
  • 147

1 Answers1

0

In case this helps someone else: If you're going Code-First, ensure your connection string is named after your custom DbContext class.

public class MyCoolContext : DbContext{}

Change your connection string name from DefaultConnection to:

<connectionStrings>
<add name="MyCoolContext" .... />

Ensure that InitializeSimpleMembershipAttribute under ~/Filters has this line:

WebSecurity.InitializeDatabaseConnection("MyCoolContext", "UserProfile", "UserId", "UserName", autoCreateTables: true);

That will ensure your membership and EF schemas are rolled into a single db.

Mister Epic
  • 16,295
  • 13
  • 76
  • 147