I'm trying to deploy an asp.net application. I really suck at it.
Anyway, parts of it are protected using Forms Authentication using SqlMembershipProvider
. I've configured the membership provider to use a SQL server instance via Web.Config.
I can use the "ASP.NET Configuration" tool via Visual Studio to create new users. That seems to work fine, and creates a new row in the database table for each user.
I can then log in to the protected areas using the newly created credentials.
That's all working nicely on the Visual Studio development debugging server.
The problem comes when I deploy it to the server. After copying the entire directory tree (including Web.Config) for the project to the server and trying to log in, using the exact same credentials, it tells me "Your login attempt was not successful. Please try again."
How is this possible?
Ugh, I hate deployment.
Update
I added the following code to the login page. When I click on the page hosted from the server, the credentials can be used on the server to log in.
protected void CreateAdminButton_Click(object sender, EventArgs e)
{
System.Web.Security.Membership.DeleteUser("admin");
System.Web.Security.Membership.CreateUser("admin", "asdfasdf", "[email protected]");
}
The new admin record is visible in the same database. The admin credentials can not be used to log in from the dev machine then. This suggests some kind of keyed hash algorithm using different keys on server and dev box to me.