Home » SQL ServerRSS

NT AUTHORITY\ANONYMOUS LOGON

Hello everybody,

I have this scenario. We on application server and sql server
Web application server contains following thinks:
IIS 7.0
Windows Server 2008
ASP.net 2.x

Sql server:
Windows Server 2008
SQL Server 2008

My web application uses following connection string:
<add name="AdventureWorksDW2008" providerName="System.Data.SqlClient" connectionString="Data Source=xxx.xx.xx.xx;Initial Catalog=databasename;Integrated Security=SSPI;

I got  this error message:

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.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 'NT AUTHORITY\ANONYMOUS LOGON'.

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 'NT AUTHORITY\ANONYMOUS LOGON'.]
   Geospatial.Data.DALMap.GetCountries() in C:\Project\old\Geospatial Framework\Geospatial Framework\Geospatial Framework\Data\DALMap.cs:29
   Geospatial_Framework.DispersionMap.PopulateCountries() in C:\Project\old\Geospatial Framework\Geospatial Framework\Geospatial Framework\DispersionMap.aspx.cs:54
   Geospatial_Framework.DispersionMap.Page_Load(Object sender, EventArgs e) in C:\Project\old\Geospatial Framework\Geospatial Framework\Geospatial Framework\DispersionMap.aspx.cs:28
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information:  Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927
<!-- [SqlException]: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. at Geospatial.Data.DALMap.GetCountries() in C:\Project\old\Geospatial Framework\Geospatial Framework\Geospatial Framework\Data\DALMap.cs:line 29 at Geospatial_Framework.DispersionMap.PopulateCountries() in C:\Project\old\Geospatial Framework\Geospatial Framework\Geospatial Framework\DispersionMap.aspx.cs:line 54 at Geospatial_Framework.DispersionMap.Page_Load(Object sender, EventArgs e) in C:\Project\old\Geospatial Framework\Geospatial Framework\Geospatial Framework\DispersionMap.aspx.cs:line 28 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.dispersionmap_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\geo\fe893e66\3b4495c0\App_Web_dispersionmap.aspx.cdcab7d2.ususf0l7.0.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->
NT AUTHORITY\ANONYMOUS LOGON'


SQL Server sql logs contains following think:


2010-01-04 13:40:52.64 Logon       Error: 18456, Severity: 14, State: 11.
2010-01-04 13:40:52.64 Logon       Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: xxx.xxx.xx.xx]


Can anyone help me ?
Jouni
 

2 Answers Found

 

Answer 1

Hello Jouni,

In your connection string you are using Integrated Security and your web application  is trying to connect with ANONYMOUS LOGON. You can change those settings in ISS Manager -> Your site properties -> Directory Security -> Authentication and access control -> Uncheck "Enable anonymous access" and check "Integrated windows  authentication".
That would work if users access your application are authenticated to sql server  domain.
You can also switch your application to use sql  Server authentication or can run your web  application in an Application Pool with windows account configured to access SQL Server.
Also, your web application server should be in the same or trusted domain with your SQL Server if you want to use Windows Authentication.

Hope that helps.

Akim
 

Answer 2

THANK YOU Akim

You answered it for me, it works.

 

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter