473,383 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Problem with sql connection with impersonate true

WT
Hello,

IIS6 on W2K3, .net 3.5, Sql 2005.
All sp applied.

My site is using windows authentication only and the web application
connects to sql server residing on another server in the same domain using
following connection string:
<connectionStrings>
<add name="My_ConnectionString"
connectionString="server=localhost;database=MyDB;T rusted_Connection=true;"
providerName="System.Data.SqlClient"/>
</connectionStrings>
When browsing on the IIS server, I have no connection problem, but when
starting the application from anoter station or server in same domain I get
following error:

System.Data.SqlClient.SqlException: Login failed for user 'NT
AUTHORITY\ANONYMOUS LOGON'.
at System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
owningObject)
at
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection)
at
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()

I don't understand why ado.net is doing the connexion with the account NT
AUTHORITY\ANONYMOUS LOGON a my current user is member of and authentified on
domain.
It even is member of an AD group which has public access to the DB used by
my application ?
Any help welcome.

CS

Nov 11 '08 #1
5 7755
On Nov 11, 6:06*am, "WT" <W...@newsgroups.nospamwrote:
Hello,

IIS6 on W2K3, .net 3.5, Sql 2005.
All sp applied.

My site is using windows authentication only and the web application
connects to sql server residing on another server in the same domain using
following connection string:
<connectionStrings>
* <add name="My_ConnectionString"
connectionString="server=localhost;database=MyDB;T rusted_Connection=true;"
providerName="System.Data.SqlClient"/>
*</connectionStrings>

When browsing on the IIS server, I have no connection problem, but when
starting the application from anoter station or server in same domain I get
following error:

System.Data.SqlClient.SqlException: Login failed for user 'NT
AUTHORITY\ANONYMOUS LOGON'.
* *at System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
owningObject)
* *at
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection)
* *at
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)
* *at System.Data.SqlClient.SqlConnection.Open()

I don't understand why ado.net is doing the connexion with the account NT
AUTHORITY\ANONYMOUS LOGON a my current user is member of and authentifiedon
domain.
It even is member of an AD group which has public access to the DB used by
my application ?

Any help welcome.

CS
You should look at adding an Identity to your configuration. One way
is simply to enter an identity tag containing user name and password
info into your application's web.config file. It would then run in the
context of that identity. There are even options for encrypting the
password.
Nov 11 '08 #2
WT
Thanks Joe,

But I need to impersonate in all the application, using credential to
authentify on other services.
My question is why SQL doesn't recognize my credentials as my IE is
configured to use them ?
Is it a windows/kerberos problem between IIS being on one server and sql on
another (2 jumps) ?
How to avod this ?

CS

"Joey" <jo*********@topscene.coma écrit dans le message de
news:f8**********************************@w39g2000 prb.googlegroups.com...
On Nov 11, 6:06 am, "WT" <W...@newsgroups.nospamwrote:
Hello,

IIS6 on W2K3, .net 3.5, Sql 2005.
All sp applied.

My site is using windows authentication only and the web application
connects to sql server residing on another server in the same domain using
following connection string:
<connectionStrings>
<add name="My_ConnectionString"
connectionString="server=localhost;database=MyDB;T rusted_Connection=true;"
providerName="System.Data.SqlClient"/>
</connectionStrings>

When browsing on the IIS server, I have no connection problem, but when
starting the application from anoter station or server in same domain I
get
following error:

System.Data.SqlClient.SqlException: Login failed for user 'NT
AUTHORITY\ANONYMOUS LOGON'.
at System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
owningObject)
at
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection)
at
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()

I don't understand why ado.net is doing the connexion with the account NT
AUTHORITY\ANONYMOUS LOGON a my current user is member of and authentified
on
domain.
It even is member of an AD group which has public access to the DB used by
my application ?

Any help welcome.

CS
You should look at adding an Identity to your configuration. One way
is simply to enter an identity tag containing user name and password
info into your application's web.config file. It would then run in the
context of that identity. There are even options for encrypting the
password.

Nov 11 '08 #3
asp.net seperates the thread nt credentials used for accessing resources and
the request credentials. by default they are seperate.

normally to access sqlserver, you need to set the app pool account to a
domain account with access to the sqlserver. if you can not update the pool
account, you can specifiy a user and and password in the web.config via the
<identitytag.

you also can enable impersonation of the web request account via this tag,
but window authenication will not allow access to a remote server (1 hop
rule), you would need to use basic or kerberos.
-- bruce (sqlwork.com)
"WT" wrote:
Hello,

IIS6 on W2K3, .net 3.5, Sql 2005.
All sp applied.

My site is using windows authentication only and the web application
connects to sql server residing on another server in the same domain using
following connection string:
<connectionStrings>
<add name="My_ConnectionString"
connectionString="server=localhost;database=MyDB;T rusted_Connection=true;"
providerName="System.Data.SqlClient"/>
</connectionStrings>
When browsing on the IIS server, I have no connection problem, but when
starting the application from anoter station or server in same domain I get
following error:

System.Data.SqlClient.SqlException: Login failed for user 'NT
AUTHORITY\ANONYMOUS LOGON'.
at System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
owningObject)
at
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection)
at
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()

I don't understand why ado.net is doing the connexion with the account NT
AUTHORITY\ANONYMOUS LOGON a my current user is member of and authentified on
domain.
It even is member of an AD group which has public access to the DB used by
my application ?
Any help welcome.

CS
Nov 11 '08 #4
Hi,

What Bruce said is reasonable. This is a typical í¦double hopí¦ issue. For
the security reason the impersonated identity can only be used to access
the resources that are owned by the web server itself.

The following article describes the í¦double hopí¦ issue in detail and
provides some workarounds:

http://blogs.msdn.com/nunos/archive/.../12/88468.aspx

If you have further questions please feel free to ask.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subs.../aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "WT" <WT@newsgroups.nospam>
| References: <3F**********************************@microsoft.co m>
<f8**********************************@w39g2000prb. googlegroups.com>
| In-Reply-To:
<f8**********************************@w39g2000prb. googlegroups.com>
| Subject: Re: Problem with sql connection with impersonate true
| Date: Tue, 11 Nov 2008 17:40:24 +0100
| Lines: 63
| Message-ID: <73**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| format=flowed;
| charset="iso-8859-1";
| reply-type=original
| Content-Transfer-Encoding: 8bit
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049
| X-MS-CommunityGroup-PostID: {73784E56-5FAD-4E19-AB55-3967B406894E}
| X-MS-CommunityGroup-ThreadID: 3FAEB607-A1D7-48DB-9EB9-03477E55BB8B
| X-MS-CommunityGroup-ParentID: 73A55EAF-493C-4261-A896-307D82E2F318
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet:79661
| NNTP-Posting-Host: TK2MSFTNGHUB02.phx.gbl 127.0.0.1
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks Joe,
|
| But I need to impersonate in all the application, using credential to
| authentify on other services.
| My question is why SQL doesn't recognize my credentials as my IE is
| configured to use them ?
| Is it a windows/kerberos problem between IIS being on one server and sql
on
| another (2 jumps) ?
| How to avod this ?
|
| CS
|
| "Joey" <jo*********@topscene.coma écrit dans le message de
| news:f8**********************************@w39g2000 prb.googlegroups.com...
| On Nov 11, 6:06 am, "WT" <W...@newsgroups.nospamwrote:
| Hello,
| >
| IIS6 on W2K3, .net 3.5, Sql 2005.
| All sp applied.
| >
| My site is using windows authentication only and the web application
| connects to sql server residing on another server in the same domain
using
| following connection string:
| <connectionStrings>
| <add name="My_ConnectionString"
| >
connectionString="server=localhost;database=MyDB;T rusted_Connection=true;"
| providerName="System.Data.SqlClient"/>
| </connectionStrings>
| >
| When browsing on the IIS server, I have no connection problem, but when
| starting the application from anoter station or server in same domain I
| get
| following error:
| >
| System.Data.SqlClient.SqlException: Login failed for user 'NT
| AUTHORITY\ANONYMOUS LOGON'.
| at System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
| owningObject)
| at
| System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
| owningConnection)
| at
| System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
| outerConnection, DbConnectionFactory connectionFactory)
| at System.Data.SqlClient.SqlConnection.Open()
| >
| I don't understand why ado.net is doing the connexion with the account
NT
| AUTHORITY\ANONYMOUS LOGON a my current user is member of and
authentified
| on
| domain.
| It even is member of an AD group which has public access to the DB used
by
| my application ?
| >
| Any help welcome.
| >
| CS
|
| You should look at adding an Identity to your configuration. One way
| is simply to enter an identity tag containing user name and password
| info into your application's web.config file. It would then run in the
| context of that identity. There are even options for encrypting the
| password.
|
|

Nov 12 '08 #5
Hi,

Do you have any progress on this issue?

Regards,
Allen Chen
Microsoft Online Community Support

Nov 20 '08 #6

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

Similar topics

1
by: YERVANT | last post by:
I have a problem with my connection. My computer is a customer Windows 2000 Professional, I installed IIS into my computer. I want use a connection with a database into the server. ( The server...
2
by: Soren Bendtsen | last post by:
Hi, I am trying to connect to a MySQL database, using the .Net framework. I installed the newest MyODCB (3.51) and the .Net ODBC drivers from Microsoft. I made a System DSN using the...
5
by: cody | last post by:
Hi I'm created a socket listening on port 1234 (it is shown that this post is in listening mode if I use NETSTAT). Now Iam trying to connect to this port: IPHostEntry entry =...
3
by: Yoshitha | last post by:
Hi I've to access registry and also get cpu id from the web application. First i wrote code to get cpuid from web application then i got cpu id. Next i wrote code to set value into a registry and...
3
by: Steven Berkovitz | last post by:
Hi there, I am having a very odd problem with localization. I have a web app with 2 embedded resources files - 1 neutral .resx file and 1 for fr-CA. With <identity impersonate="true" /> the...
0
by: Yoshitha | last post by:
Hi I've to access registry and also get cpu id from the web application. First i wrote code to get cpuid from web application then i got cpu id. Next i wrote code to set value into a registry and...
2
by: KaNos | last post by:
Hello world, I've made a webservice (c# v2) to install in a server IIS 6 on a Windows 2000 last SP. We can use the webservice in local, throw the pages wich present the methods, with a windows...
0
by: devtalex | last post by:
hello all!... i'm novice here... I've such kind of issue. The purpose of my code is to copy a number of files by FTP (using different ports every time). There are different numbers of files...
0
by: Rauf Sarwar | last post by:
Originally posted by Nelson Broat Have you included Oracle jdbc driver in your classpath? Depending on your Oracle version, it would be ORACLE_HOME/jdbc/lib/classesXXX.zip or classesXXX.jar...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.