deNZity
asked on
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
I get the following error when a user tries to logon from work station.
The website is hosted on IIS on the same server as sql server 2005
website is asp.net 2.0
SqlException (0x80131904): Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.]
System.Data.SqlClient.SqlI nternalCon nection.On Error(SqlE xception exception, Boolean breakConnection) +734883
System.Data.SqlClient.TdsP arser.Thro wException AndWarning (TdsParser StateObjec t stateObj) +188
System.Data.SqlClient.TdsP arser.Run( RunBehavio r runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.Data.SqlClient.SqlI nternalCon nectionTds .CompleteL ogin(Boole an enlistOK) +33
System.Data.SqlClient.SqlI nternalCon nectionTds .OpenLogin Enlist(Sql Connection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628
System.Data.SqlClient.SqlI nternalCon nectionTds ..ctor(DbC onnectionP oolIdentit y identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
System.Data.SqlClient.SqlC onnectionF actory.Cre ateConnect ion(DbConn ectionOpti ons options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
System.Data.ProviderBase.D bConnectio nFactory.C reatePoole dConnectio n(DbConnec tion owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.D bConnectio nPool.Crea teObject(D bConnectio n owningObject) +424
System.Data.ProviderBase.D bConnectio nPool.User CreateRequ est(DbConn ection owningObject) +66
System.Data.ProviderBase.D bConnectio nPool.GetC onnection( DbConnecti on owningObject) +496
System.Data.ProviderBase.D bConnectio nFactory.G etConnecti on(DbConne ction owningConnection) +82
System.Data.ProviderBase.D bConnectio nClosed.Op enConnecti on(DbConne ction outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlC onnection. Open() +111
System.Web.DataAccess.SqlC onnectionH older.Open (HttpConte xt context, Boolean revertImpersonate) +84
System.Web.DataAccess.SqlC onnectionH elper.GetC onnection( String connectionString, Boolean revertImpersonation) +197
System.Web.Security.SqlMem bershipPro vider.GetP asswordWit hFormat(St ring username, Boolean updateLastLoginActivityDat e, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount , Int32& failedPasswordAnswerAttemp tCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121
System.Web.Security.SqlMem bershipPro vider.Chec kPassword( String username, String password, Boolean updateLastLoginActivityDat e, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
System.Web.Security.SqlMem bershipPro vider.Chec kPassword( String username, String password, Boolean updateLastLoginActivityDat e, Boolean failIfNotApproved) +42
System.Web.Security.SqlMem bershipPro vider.Vali dateUser(S tring username, String password) +83
System.Web.UI.WebControls. Login.OnAu thenticate (Authentic ateEventAr gs e) +160
System.Web.UI.WebControls. Login.Atte mptLogin() +105
System.Web.UI.WebControls. Login.OnBu bbleEvent( Object source, EventArgs e) +99
System.Web.UI.Control.Rais eBubbleEve nt(Object source, EventArgs args) +35
System.Web.UI.WebControls. Button.OnC ommand(Com mandEventA rgs e) +115
System.Web.UI.WebControls. Button.Rai sePostBack Event(Stri ng eventArgument) +163
System.Web.UI.WebControls. Button.Sys tem.Web.UI .IPostBack EventHandl er.RaisePo stBackEven t(String eventArgument) +7
System.Web.UI.Page.RaisePo stBackEven t(IPostBac kEventHand ler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePo stBackEven t(NameValu eCollectio n postData) +33
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +5102
The website is hosted on IIS on the same server as sql server 2005
website is asp.net 2.0
SqlException (0x80131904): Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.]
System.Data.SqlClient.SqlI
System.Data.SqlClient.TdsP
System.Data.SqlClient.TdsP
System.Data.SqlClient.SqlI
System.Data.SqlClient.SqlI
System.Data.SqlClient.SqlI
System.Data.SqlClient.SqlC
System.Data.ProviderBase.D
System.Data.ProviderBase.D
System.Data.ProviderBase.D
System.Data.ProviderBase.D
System.Data.ProviderBase.D
System.Data.ProviderBase.D
System.Data.SqlClient.SqlC
System.Web.DataAccess.SqlC
System.Web.DataAccess.SqlC
System.Web.Security.SqlMem
System.Web.Security.SqlMem
System.Web.Security.SqlMem
System.Web.Security.SqlMem
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Control.Rais
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Page.RaisePo
System.Web.UI.Page.RaisePo
System.Web.UI.Page.Process
ASKER
thanks for the reply, I want to be able to use the NetworkService account.
"In Internet Information Services (IIS) 6, the default identity is the NetworkService account."
How do I go about setting this up so the website and sql server 2005 allow the NetworkService user?
"In Internet Information Services (IIS) 6, the default identity is the NetworkService account."
How do I go about setting this up so the website and sql server 2005 allow the NetworkService user?
Go to the property of your site in IIS -> Directory Security Tab -> Edit 'Anoymous....' -> Check 'Integrated Windows Authentication'
Start SQL management studio -> select DB -> Security -> Logins
And add the user account that access that you need, and give the permission to access your DB.
Start SQL management studio -> select DB -> Security -> Logins
And add the user account that access that you need, and give the permission to access your DB.
ASKER
furi2, that has already been done.
do u mean that you have already removed the anonymous acess?
Rejo
Rejo
is your sql server also setup for mixed mode authentication or windows authentication? if windows authentication, what is the domain under which it runs? do u also have <identity impersonate="true"/> in web.config file of the website?
ASKER
Hi Rejojohny,
I have this website operating on the same server as the database(IIS, SQL 2005 )
Both the database and the website need to be moved to a new server.
I setup IIS on new server and deployed site using visual studio.
I then backed up the database and copied .BAK file to sql server and restored db
using sql management studioAll the settings are the same yet I get the error?
I have this website operating on the same server as the database(IIS, SQL 2005 )
Both the database and the website need to be moved to a new server.
I setup IIS on new server and deployed site using visual studio.
I then backed up the database and copied .BAK file to sql server and restored db
using sql management studioAll the settings are the same yet I get the error?
Using Network Service really isn't an option here, as the Network Service account impersonates the machine account of the server which the request leaves. Create a domain account, grant it NTFS rights to your data, and run your application pool with that account. Then grant that account access to your database.
Best of luck,
harperse
Best of luck,
harperse
ASKER
Thankyou for the replies, The problem was in one of the connection strings used on the site.
I had changed all but one of the strings to reflect the change of server name.
Once this string was changed as well then everything worked ok.
I had changed all but one of the strings to reflect the change of server name.
Once this string was changed as well then everything worked ok.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
* that IIS is configured to allow anonymeous access and/or does not configure to use windows authenication
* that the (asp.net) page connects using windows authentication, but eventually you also need to grant the mentioned login in sql server the permission (if you keep the anonymeous access configured)