I have an ASP.NET 4.0 app and am trying to implement the Login control using the Membership framework and a SQL server database. I've done the following:
1. Configured SQL with the aspnet_regsql
2. Confirmed that the tables are being populated with user data using the CreateUserWizard control.
3. Confirmed that users "IsApproved" flag gets set when the authentication email is answered.
4. Created a "Admin" role and confirmed that the user is in this role.
5. Changed the applicationName attribute from the default "/" in web.config
1. Tried to login with this confirmed user and keep getting the "Your login attempt was not successful. Please try again." error.
2. Tried without adding any code behind to the Login control. Same result.
3. Added custom code to the Login.Authenticate event for debugging purposes
Membership.ValidateUser yields e.Authenticated = false
The Membership object has all the correct connection information
The User.Identity information : Name "", IsAuthenticated false, AuthenticationType ""
ProviderName matches what is in web.config
So, I know my database connection works as I can create users through the app. I've also tested all providers with the Web Site Administration tool.
What am I missing? It's got to be something simple. I was under the assumption that you do not need any custom code (like writing queries to the aspnet_User tables, etc.) for this to work.
This is really holding up production, so any assistance is greatly appreciated!