Membership Provider Connections to remote database in IIS7 Windows 2008 Web Server
I recently went through a nightmare with getting the Membership Provider Login and any other Membership Provider methods to work using Windows 2008 Web Server and IIS7 connecting to a remote SQL Server 2008 database.
I was consistently getting this error (using windows authentication):
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
From the web server, my web site could connect to the database, display a grid from the tables, insert and update tables, but could not perform any of the membership provider methods. When running my app locally via Visual Studio 2008, I could use the log in control fine, just not from the actual web application.
Thanks to Rick Anderson for his tenacity in sticking with me to find a solution, I am going to explain it here so you won't have to go through what I went through...
If you have your database connection working, but your Membership Provider log ins, etc. are failing, do this:
In IIS7 on your Windows 2008 Web Server...
Please go to Application Pools.
Select your web site.
Click "Advanced Settings" in the "Actions" panel.
Under "Process Model" select "Identity."
In the popup, select the "Custom account" radio button.
"Set" the account and password to your dbo account name and password that are used on your SQL Server 2008 database.
Save that.
Under sites, go to your website. In the Features View panel, select "Authentication" under IIS. Under ASP.Net Impersonation, make sure it's Disabled.
Your web.config will be changed to this:
<identity impersonate="false" />
You may wish to copy your web.config changes made on the server to your local web site in Visual Studo to get the latest copy.
May your dreams be in ASP.net!
Nannette