By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,262 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,262 IT Pros & Developers. It's quick & easy.

asp.net sqlmembershipprovider integrated security

P: n/a
Hi all,
I've been debating for a while (basically since asp.net 2.0 came out) on
using the built in mebership classes to handle user management in my web
apps. I seem to keep coming upon roadblocks that keep me from jumping in.
Well this time is no different. While trying to use an asp.net
sqlmembershipprovider to create a new user, I get the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Login failed for user 'DOMAIN\MACHINENAME$'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user
'DOMAIN\MACHINENAME$'.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Login failed for user 'DOMAIN\MACHINENAME$'.]
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, Boolean breakConnection) +739123
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject
stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj) +1956
System.Data.SqlClient.SqlInternalConnectionTds.Com pleteLogin(Boolean
enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
timerExpire, SqlConnection owningObject) +170
System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String
host, String newPassword, Boolean redirectedUserInstance, SqlConnection
owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +349
System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String newPassword,
Boolean redirectedUserInstance) +181
System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, Object providerInfo, String
newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
+170
System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection) +359
System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection
owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection
owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection
owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Web.DataAccess.SqlConnectionHolder.Open(Htt pContext context,
Boolean revertImpersonate) +84
System.Web.DataAccess.SqlConnectionHelper.GetConne ction(String
connectionString, Boolean revertImpersonation) +197
System.Web.Security.SqlMembershipProvider.GetPassw ordWithFormat(String
username, Boolean updateLastLoginActivityDate, Int32& status, String&
password, Int32& passwordFormat, String& passwordSalt, Int32&
failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount,
Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate)
+1121
System.Web.Security.SqlMembershipProvider.CheckPas sword(String username,
String password, Boolean updateLastLoginActivityDate, Boolean
failIfNotApproved, String& salt, Int32& passwordFormat) +105
System.Web.Security.SqlMembershipProvider.CheckPas sword(String username,
String password, Boolean updateLastLoginActivityDate, Boolean
failIfNotApproved) +42
System.Web.Security.SqlMembershipProvider.Validate User(String username,
String password) +83
System.Web.UI.WebControls.Login.OnAuthenticate(Aut henticateEventArgs e)
+160
System.Web.UI.WebControls.Login.AttemptLogin() +105
System.Web.UI.WebControls.Login.OnBubbleEvent(Obje ct source, EventArgs e)
+99
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(Command EventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument)
+163
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET
Version:2.0.50727.832

Here's my configuration situation. I'm running .net 2.0 and sql server
2005. I'm using integrated security in my connection string similar to
"Data Source=SERVER;Initial Catalog=DATABASE;Trusted_Connection=True;". The
applicaiton in IIS is running as a network level user that has db_owner
access to the database in the connection string. The user is impersonated
in the web.config using "<identity impersonate="true"/>". The rest of the
database access on the site works fine using the same connection string. I
only get the error above when trying to do the membership functionality. It
almost looks like when I use the classes that it drops the annonymous user
and goes back to using a machine level account.

Any help would be greatly appreciated.

Thanks,
Matt
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Anyone have any thoughts on this?

"Matt MacDonald" <ma******@hotmail.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
Hi all,
I've been debating for a while (basically since asp.net 2.0 came out) on
using the built in mebership classes to handle user management in my web
apps. I seem to keep coming upon roadblocks that keep me from jumping in.
Well this time is no different. While trying to use an asp.net
sqlmembershipprovider to create a new user, I get the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Login failed for user 'DOMAIN\MACHINENAME$'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for
user 'DOMAIN\MACHINENAME$'.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Login failed for user 'DOMAIN\MACHINENAME$'.]
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, Boolean breakConnection) +739123

System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject
stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj) +1956
System.Data.SqlClient.SqlInternalConnectionTds.Com pleteLogin(Boolean
enlistOK) +33

System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
timerExpire, SqlConnection owningObject) +170
System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String
host, String newPassword, Boolean redirectedUserInstance, SqlConnection
owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
+349

System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String newPassword,
Boolean redirectedUserInstance) +181

System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, Object providerInfo,
String newPassword, SqlConnection owningObject, Boolean
redirectedUserInstance) +170

System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection) +359

System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection
owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection
owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection
owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Web.DataAccess.SqlConnectionHolder.Open(Htt pContext context,
Boolean revertImpersonate) +84
System.Web.DataAccess.SqlConnectionHelper.GetConne ction(String
connectionString, Boolean revertImpersonation) +197
System.Web.Security.SqlMembershipProvider.GetPassw ordWithFormat(String
username, Boolean updateLastLoginActivityDate, Int32& status, String&
password, Int32& passwordFormat, String& passwordSalt, Int32&
failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount,
Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate)
+1121
System.Web.Security.SqlMembershipProvider.CheckPas sword(String username,
String password, Boolean updateLastLoginActivityDate, Boolean
failIfNotApproved, String& salt, Int32& passwordFormat) +105
System.Web.Security.SqlMembershipProvider.CheckPas sword(String username,
String password, Boolean updateLastLoginActivityDate, Boolean
failIfNotApproved) +42
System.Web.Security.SqlMembershipProvider.Validate User(String username,
String password) +83
System.Web.UI.WebControls.Login.OnAuthenticate(Aut henticateEventArgs e)
+160
System.Web.UI.WebControls.Login.AttemptLogin() +105
System.Web.UI.WebControls.Login.OnBubbleEvent(Obje ct source, EventArgs
e) +99
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
+35
System.Web.UI.WebControls.Button.OnCommand(Command EventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEven t(String
eventArgument) +163

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.832;
ASP.NET Version:2.0.50727.832

Here's my configuration situation. I'm running .net 2.0 and sql server
2005. I'm using integrated security in my connection string similar to
"Data Source=SERVER;Initial Catalog=DATABASE;Trusted_Connection=True;".
The applicaiton in IIS is running as a network level user that has
db_owner access to the database in the connection string. The user is
impersonated in the web.config using "<identity impersonate="true"/>".
The rest of the database access on the site works fine using the same
connection string. I only get the error above when trying to do the
membership functionality. It almost looks like when I use the classes
that it drops the annonymous user and goes back to using a machine level
account.

Any help would be greatly appreciated.

Thanks,
Matt

Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.