473,469 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

Hi All,

I am developing one ASP.NET 2.0 application in which user test the remote
sql server existance. User enters remote sql server name, data base name,
authentication mode, user name, password. I am making the connection string
based on the authentication mode. If it is integrated authentication my
connection string would be as below.

try
{
string s = txtserver.Text;
string d = txtdatabase.Text;
System.Data.SqlClient.SqlConnection conn = new
System.Data.SqlClient.SqlConnection();
string constr = "Data Source=" + s + ";Initial Catalog=" + d +
";Integrated Security=SSPI";
conn.ConnectionString = constr;
conn.Open();
if (conn.State == ConnectionState.Open)
{
Response.Write("success");
}
conn.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message + "<br>");
}

This code is working fine if the portal is accessed using
http://localhost/... but it is failing when the portal is accessed using
http://host_name/.... and tries to test the remote sql server connection. I
enabled impersonation also in web.config file as below

<authentication mode="Windows"/>
<identity impersonate="true"/>

When user is accessing the portal from remote machine http://host_name/ and
trying to test the remote sql server the above code is failing and giving
the error as Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. My web
site is configured to use Integrated windows authentication. I searched the
web for this problem but nothing is worked for me. I am surprising why the
requested user credentials are not passing

Please help me to solve this problem as this very important for me.

Thanks in advance.

Srinivas Ch
Nov 10 '06 #1
1 6581
To do this with Windows 2000 machines you must have Kerberos security set up.

You are doing a double-hop.

You need to enable security account delegation on the IIS machine. This Windows
2000 feature lets the client connect to multiple servers and pass the
authentication credentials of the original client to each of the servers. You
can use the Active Directory Users and Computers administration tool to check
the Computer is trusted for delegation.

Plenty of links out there about how to do it.

On Fri, 10 Nov 2006 17:00:02 +0530, "Srinivas Chintakindi" <ch****@aim.com>
wrote:
>Hi All,

I am developing one ASP.NET 2.0 application in which user test the remote
sql server existance. User enters remote sql server name, data base name,
authentication mode, user name, password. I am making the connection string
based on the authentication mode. If it is integrated authentication my
connection string would be as below.

try
{
string s = txtserver.Text;
string d = txtdatabase.Text;
System.Data.SqlClient.SqlConnection conn = new
System.Data.SqlClient.SqlConnection();
string constr = "Data Source=" + s + ";Initial Catalog=" + d +
";Integrated Security=SSPI";
conn.ConnectionString = constr;
conn.Open();
if (conn.State == ConnectionState.Open)
{
Response.Write("success");
}
conn.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message + "<br>");
}

This code is working fine if the portal is accessed using
http://localhost/... but it is failing when the portal is accessed using
http://host_name/.... and tries to test the remote sql server connection. I
enabled impersonation also in web.config file as below

<authentication mode="Windows"/>
<identity impersonate="true"/>

When user is accessing the portal from remote machine http://host_name/ and
trying to test the remote sql server the above code is failing and giving
the error as Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. My web
site is configured to use Integrated windows authentication. I searched the
web for this problem but nothing is worked for me. I am surprising why the
requested user credentials are not passing

Please help me to solve this problem as this very important for me.

Thanks in advance.

Srinivas Ch
Nov 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: cerilocke | last post by:
I have an identical SQL database on two machines (my machine and a web server) that links to a database on a third server (S3). When I execute a stored procedure on my machine that accesses a...
3
by: Mike Hutton | last post by:
Hi, I have tried to keep things simple. Not simple enough, obviously. I have a set of intranet ASP.NET pages which access a SQL back-end through the normal SQLConnection stuff. I want to use...
3
by: Maellic | last post by:
Hi, The website I am working on is built with ASP.NET and connects to a SQL Server 2000 database. The web server and database are on the same machine. I have recently tried to modify the timeout...
10
by: et | last post by:
I have an asp.net program that uses a connection string, using integrated security to connect to a sql database. It runs fine on one server, but the other server gives me the error that "Login...
4
by: Chuck Bowling | last post by:
I'm having a problem that i really don't understand. I'm new to ASP.NET and to SQL Server (MSDE). I'm trying to get a VS walkthru in the C# to work. I think the problem is permissions but I'm not...
2
by: Andrzej Magdziarz | last post by:
Hello, (sorry for my English...) Could you help me with a SQL Server 2005 problem? I had installed SQL Server 2005 and then I tried to setup some application using SQL Server. Unfortunatelly...
3
by: SAL | last post by:
Hello, I'm a total asp.net newbie. I'm developing a web app and on my machine I login to a sql server just fine using NT Authentication via the connection string as: Integrated Security=True ...
3
by: gderosa | last post by:
I have been getting that dreaded error in my application: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. I have had my application in the test environment, impersonating it using a...
4
by: eruth | last post by:
There are loads of post on this, but nothing that seems to cover my exact problem ;) I have an ASP.Net 1.1 web application running on my local machine. I want to connect to an SQL 2005 server...
1
by: cactuscrust | last post by:
I'm running IIS6 Windows2003, and as you'll see very quickly.. I'm pretty new to this stuff. Lately I've been getting bombarded with login attempts.... sometimes several in the same second, and it...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.