Hello all
I've developing a simple ASP.NET 2.0 appl using Forms authentication with membership and roleprovider data in a remote SQL database.
My setup:
PC1: Developing PC, XP Home edition, with VS 2005,
PC2: Deploy PC, XP Pro edition, IIS 5.1, SQL Server Express. Anonymous logon is turned OFF in IIS
I've read many good blogs about the topic (Scott Guthrie: http://weblogs.asp.net/scottgu/archive/2006/02/24/ASP.NET-2.0-Membership_2C00_-Roles_2C00_-Forms-Authentication_2C00_-and-Security-Resources-.aspx and Scott Mitchell).
I've followed guides to setup membership database in SQL Express db at PC2 using aspnet_regsql.exe. (However: Scott Guthries guide is telling how to setup remote membership db in 2000 or 2005 SQL server. I've used SQL Express 2005) When developing at PC1, I can use ASP.NET Web Site Administration Tool to setup Users and Roles in this membership database. (Data enteres can be confirmed by browsing DB). My web.config file contains these lines to "point" to the remote database instead of default SQL Express database:
<connectionStrings>
<!--
Remove LocalSqlServer to remove the default connection to SQL Express ... then add to the remote intance Ref: http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx -->
<
remove name="LocalSqlServer"/>
<
add name="LocalSqlServer"
connectionString="Data Source=DIMENSION4550;Initial Catalog=usersandroles;Integrated Security=True"providerName="System.Data.SqlClient" />
</
connectionStrings><system.web>
<
identity impersonate="true"/><membership defaultProvider="CustomizedMembershipProvider">
<
providers>
<
add name="CustomizedMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LocalSqlServer"
applicationName="/mpa"
requiresUniqueEmail="false"
minRequiredPasswordLength="5"minRequiredNonalphanumericCharacters="0" />
</
providers></membership>
<
roleManager enabled="true" defaultProvider="CustomizedRoleProvider"><providers>
<
add name="CustomizedRoleProvider"
type="System.Web.Security.SqlRoleProvider"
applicationName="/mpa"connectionStringName="LocalSqlServer" />
</
providers>
</
roleManager>
.....
When running solution in debug mode at PC1, all works as intended. I'm using VS -> Build -> Publish to deploy the solution to PC2. When accessing solution at PC2 (from localhost at PC2 or through internet), When accessing pages, I first logon to IIS (no anonymous access) using an account on PC2. Further I can open my solution, the part which don't need authentication.
The problem:
I can't get the solution to log on to my usersandroles database. Exception is thrown once my code is accessing membership parts (i.e: login): [SqlException (0x80131904): Login failed for user 'DIMENSION4550\ASPNET'.] I think I've tried most combinations in connectionstring and identety impersonate to logon, but no success (User ID / Password in clear text)
Ideas? Where do I fail?
Jan