Showing posts with label tries. Show all posts
Showing posts with label tries. Show all posts

Friday, March 30, 2012

Login failed for user NT AUTHORITY\ANONYMOUS LOGON.

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.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734883
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehaviorrunBehavior, SqlCommand cmdHandler, SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)+1838
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentityidentity, SqlConnectionString connectionOptions, Object providerInfo,String newPassword, SqlConnection owningObject, BooleanredirectedUserInstance) +170
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197
System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(Stringusername, 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.CheckPassword(Stringusername, String password, Boolean updateLastLoginActivityDate, BooleanfailIfNotApproved, String& salt, Int32& passwordFormat) +105
System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160
System.Web.UI.WebControls.Login.AttemptLogin() +105
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

Hi,

i think you have allowed ANONYMOUS Access to your website in the IIS Admin. The ASP.NET worker process using the ANONYMOUS user account and the process-user will connect to your SQL Database. Is that realy what you want? I think you have a special sql user account, or? So you must impersonate your asp.net worker process. See this MSDN Article for more information about impersonation:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxconImpersonation.asp

Regards
Marc André

|||

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?

|||

ghw123:

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?

Try the link below for how to use T-SQL to grant the Networkservice account permissions in SQL Server to run Asp.net. Hope this helps.

http://www.thedatafarm.com/blog/PermaLink.aspx?guid=2bd8f8c8-1b16-46ee-91f6-d8d3080e562b

|||

Thanks for the reply I tried the

sp_grantlogin 'NT AUTHORITY\NETWORK SERVICE' on the master database

but no luck still get the same error msg.

|||

ghw123:

Thanks for the reply I tried the

sp_grantlogin 'NT AUTHORITY\NETWORK SERVICE' on the master database

but no luck still get the same error msg.

The first thing to do is verify in the Master database that the account was created and if yes then your only option is to use basic autthentication which could leave your application passwords in plain text. Hope this helps.

|||

Add the aspnet account to the SQL server 2005

Please have a look at thishttp://ambarishganguly.blogspot.com/2007/01/aspnet-account-and-sql-server.html. .

To add a user in SQL Server 2005, you can follow the following steps as outlined in

http://ambarishganguly.blogspot.com/2006/12/sql-server-2005-adding-user.html

In this way, you can easily use the website along with SQL Server 2005

Thanks

Ambarish.

|||

thanks for the replies,

this site was originally on a different server. I moved both the site and the database to the new server.

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.

Monday, March 12, 2012

Login Error - Please Help

I have created a site using a login through the Asp.net Admin Website Tool. Through numerous tries of trying to get this to work, I am now receiving the following error "Login failed for user 'app1_lakeshore'." Can anyone help?

Here is my werbconfig file:

<?xmlversion="1.0"?>

<!--

Note: As an alternative to hand editing this file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

appSettings>

<

addkey="/LMCIntranet" />

</

appSettings>

<

connectionStrings>

<

removename="LocalSqlServer"/>

<

addname="LocalSqlServer"connectionString="Data Source=sqldev2.aurora.org;Initial Catalog=Lakeshore;Persist Security Info=True;User ID=app1_lakeshore"providerName="System.Data.SqlClient"/>

</

connectionStrings>

<

system.web>

<!--

Set compilation debug="true" to insert debugging

symbols into the compiled page. Because this

affects performance, set this value to true only

during development.

Visual Basic options:

Set strict="true" to disallow all data type conversions

where data loss can occur.

Set explicit="true" to force declaration of all variables.

-->

<

authenticationmode="Forms" />

<

customErrorsmode="Off"/>

<

compilationdebug="true"strict="false"explicit="true"/>

<

pages>

<

namespaces>

<

clear/>

<

addnamespace="System"/>

<

addnamespace="System.Collections"/>

<

addnamespace="System.Collections.Specialized"/>

<

addnamespace="System.Configuration"/>

<

addnamespace="System.Text"/>

<

addnamespace="System.Text.RegularExpressions"/>

<

addnamespace="System.Web"/>

<

addnamespace="System.Web.Caching"/>

<

addnamespace="System.Web.SessionState"/>

<

addnamespace="System.Web.Security"/>

<

addnamespace="System.Web.Profile"/>

<

addnamespace="System.Web.UI"/>

<

addnamespace="System.Web.UI.WebControls"/>

<

addnamespace="System.Web.UI.WebControls.WebParts"/>

<

addnamespace="System.Web.UI.HtmlControls"/>

</

namespaces>

</

pages>

<!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

-->

<!--

The <customErrors> section enables configuration

of what to do if/when an unhandled error occurs

during the execution of a request. Specifically,

it enables developers to configure html error pages

to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm" />

<error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>

-->

</

system.web>

<

system.net>

<

mailSettings>

<

smtpfrom="vanessa.edwards@.aurora.org">

<

networkhost="localhost"password=""userName="" />

</

smtp>

</

mailSettings>

</

system.net>

</

configuration>

It looks like you need to add the password to the connection string. Without the TrustedConnection parameter it will be using SQL Server authentication (authenticating against a SQL Server user ID). If you want to use the current Windows id you'll want to set TrustedConnection=true and omit username and password from the connection string.|||

I am still getting the same error - what am I doing wrong?

<

addname="LocalSqlServer"connectionString="Data Source=sqldev2.aurora.org;Initial Catalog=Lakeshore;Persist Security Info=True;User ID=app1_lakeshore;Password=need1004"providerName="System.Data.SqlClient"/>

</

connectionStrings>

Please HELP!!!!

|||

Hi,

I suggest you try to create a UDL file to test the connection to see if the username and password can work.

Here are the steps

1. Create a normal Text file.
2. Rename it to .udl extension.
3. Double click on that file and a Data Link Properties dialog box will be show.
4. Select the provider and data source, specify username and password, and click the Test Connection button for test.