Showing posts with label website. Show all posts
Showing posts with label website. 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 19, 2012

Login failed for ".

What am I missing? Computer A is windows xp sp2 with visual studio 2005. Computer B is Server2003 with SQLServer2005.

Computer A: local website directory security configured for anonymous access using a local user computer_A\username and password. The password is NOT managed by iIIS.

Computer B: SQLServer2005 allows local and remote connections, sql server and windows authentication. Local user computer_B\username and password is defined.

User computer_B\username is defined in the sql server security logins with login properties allowing access to database mydb. The default scheama db_owner. The database (mydb) properties/permissions/effective permissions are Authenticate, connect, delete,execute,insert,select and update.

The webconfig file has a connection string defined as:Name=LocalSqlServer Connection String=Data Source=server.domain-name,1433;Initial Catalog=mydb;Integrated Security=True;. The webconfig file contains <remove name="LocalSqlServer" and then an <add name="LocalSqlServer" with the above information. The webconfig file also has <identity impersonate="true" /> and <authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" loginUrl="login.aspx" protection="Validation"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>

My login page manually reads a table called usrTbl via a stored proceedure to check for the existance of the username and password presented.(Yes I know it is in the clear-bad bad me, just bear with me for the problem). It then formsredirectfromlogin to the original requested page whice is Default.aspx.

Default.aspx has a gridview defined. The datasource is defined in the page load event as:

gridview1.datasource = membership.getallusers()

gridview1.databind()

I get an error Login failed for ". User not associated with a trusted connection

How can that be, the database has been access earlier with the same connection string. I checked to make sure user computer_B\username can log on to computer B.

Please help me to understand a solution to this

You may hit the same issue discussed in the following thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=285649&SiteID=1

Thanks
Laurentiu

|||

Not the same thing. I know my post was long, but i needed to provide the complete environment.

Failure is with different tables in the same database. I guess I failde to say the membership tables were created in the same database. Bottom Line Here.

Read database table fine, redirect to different page, failure reading same database.

WHY

|||

Pasting answer from usenet forum:

Hi Bill,

Welcome to use MSDN Managed Newsgroup Support.

From your description, my understanding is that, you can not config a web
application to connect to the remote SQL Server instance. If I
misunderstood your concern, please feel free to point it out.

Please use the following entry for the <identity> in web.config.

<identity impersonate="true" userName="computer_b\username"
password="password" />

Since you impersonated in your web application but you did not give a
credential to the application, so that, it will use the IIS account to
connect to the SQL Server. Of cause this will cause the login error.

Hope this will be helpful.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

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.

login and web admin tool

I've been trying to get my website back up and running, I lost the db and will have to reconstruct that but in the meantime I would like to get the website back in operation right now I have the following problems.

    I receive an error message when trying to create a new user in the web admin tool. see 1A

    or I receive another error message saying that the administrator is not authorized to sign onto the db

    and I seem to have the authorization settings incorrect for the hashed password settings I had...

Ive looked back through my notes and the last time this happened I created a new database with the web admin tool but my settings are such that this still doesn't eliminate the error messages. Right now the website is in a cannot find server mode.

Thanks for your help.

Debbie

1A Exception has been thrown by the target of an invocation. at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Web.Administration.WebAdminMembershipProvider.CallWebAdminMembershipProviderHelperMethodOutParams(String methodName, Object[] parameters, Type[] paramTypes) at System.Web.Administration.WebAdminMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Still having a problem. does anyone answer these forums? Since Microsoft is not offering support on VWD 2005 and it sends you to these forums for answers don't you think that they should staff the forums? for at least a modicum of support. Who - ever heard of a product being released without a repair system in place? HELP REQUESTED.

Here are a few suggestions to start:

http://www.aquesthosting.com/HowTo/Sql2005/SQLError26.aspx

Buck Woody

Friday, March 9, 2012

login and web admin tool

I've been trying to get my website back up and running, I lost the db and will have to reconstruct that but in the meantime I would like to get the website back in operation right now I have the following problems.

    I receive an error message when trying to create a new user in the web admin tool. see 1A

    or I receive another error message saying that the administrator is not authorized to sign onto the db

    and I seem to have the authorization settings incorrect for the hashed password settings I had...

Ive looked back through my notes and the last time this happened I created a new database with the web admin tool but my settings are such that this still doesn't eliminate the error messages. Right now the website is in a cannot find server mode.

Thanks for your help.

Debbie

1A Exception has been thrown by the target of an invocation. at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Web.Administration.WebAdminMembershipProvider.CallWebAdminMembershipProviderHelperMethodOutParams(String methodName, Object[] parameters, Type[] paramTypes) at System.Web.Administration.WebAdminMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Still having a problem. does anyone answer these forums? Since Microsoft is not offering support on VWD 2005 and it sends you to these forums for answers don't you think that they should staff the forums? for at least a modicum of support. Who - ever heard of a product being released without a repair system in place? HELP REQUESTED.

Here are a few suggestions to start:

http://www.aquesthosting.com/HowTo/Sql2005/SQLError26.aspx

Buck Woody