Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

Reply
Thread Tools

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

 
 
Srinivas Chintakindi
Guest
Posts: n/a
 
      11-10-2006
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


 
Reply With Quote
 
 
 
 
Jay Pondy
Guest
Posts: n/a
 
      11-30-2006
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" <(E-Mail Removed)>
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
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot open user default database. Login failed. Login failed for user 'HEMPC\ASPNET' Tony Johansson ASP .Net 3 01-02-2010 04:09 PM
Cannot open database requested in login 'HumanResources'. Login failed for user 'companyDomain\BOSIIS$'. Homer ASP .Net 3 09-25-2007 07:45 PM
Error:Login failed for user ''. The user is not associated with a trusted SQL Server connection. CFTK ASP .Net 5 01-09-2007 10:51 AM
Login failed for user ''. The user is not associated with a trusted SQL Server connection. Dennis ASP .Net 0 06-26-2006 03:55 PM
Login failed for user ''. The user is not associated with a truste =?Utf-8?B?U3lsdmFu?= ASP .Net 4 11-26-2005 04:35 AM



Advertisments