473,394 Members | 1,697 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,394 software developers and data experts.

impersonate with SQL Server on the same domain

We are attempting to use impersonation to connect from our ASP.NET website
to a SQL Server on the same domain. The code below works just fine in our
web.config file:

<identity impersonate="true" userName="mydomain\mylogin"
password="whatever">

However, if we attempt to impersonate the user that currently is logged in
to the client computer using ...

<identity impersonate="true">

we get the error message:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

I'm an SA on the SQL Server box ... something else isn't quite clicking.
Any recommendations? In IIS we have Integrated Windows Authentication
checked, and nothing else.

Thanks in advance.

Mark
fi******@umn.edu


Nov 18 '05 #1
6 2532
just as a test, try Basic instead of Integrated auth once....

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
We are attempting to use impersonation to connect from our ASP.NET website
to a SQL Server on the same domain. The code below works just fine in our
web.config file:

<identity impersonate="true" userName="mydomain\mylogin"
password="whatever">

However, if we attempt to impersonate the user that currently is logged in
to the client computer using ...

<identity impersonate="true">

we get the error message:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

I'm an SA on the SQL Server box ... something else isn't quite clicking.
Any recommendations? In IIS we have Integrated Windows Authentication
checked, and nothing else.

Thanks in advance.

Mark
fi******@umn.edu


Nov 18 '05 #2
to pass the users credentials to the sqlserver (on a different box),
delegation is required. ntlm does support delegation. only basic (which
gives iis a primary token which is allowed 1 hop) and digest (if delegation
is enabled) support passing user creditals from the iis box to a different
box.

-- bruce (sqlwork.com)
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:#V**************@TK2MSFTNGP12.phx.gbl...
We are attempting to use impersonation to connect from our ASP.NET website
to a SQL Server on the same domain. The code below works just fine in our
web.config file:

<identity impersonate="true" userName="mydomain\mylogin"
password="whatever">

However, if we attempt to impersonate the user that currently is logged in
to the client computer using ...

<identity impersonate="true">

we get the error message:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

I'm an SA on the SQL Server box ... something else isn't quite clicking.
Any recommendations? In IIS we have Integrated Windows Authentication
checked, and nothing else.

Thanks in advance.

Mark
fi******@umn.edu


Nov 18 '05 #3
Bruce,

I executed the following code:

System.Security.Principal.IIdentity ii = User.Identity;
System.Security.Principal.WindowsIdentity wi = WindowsIdentity.GetCurrent();

Response.Write("<br>IIdentity.AuthenticationType: " +
ii.AuthenticationType);
// Displays: IIdentity.AuthenticationType: Negotiate

Response.Write("<br>WindowsIdentity.Authentication Type: " +
wi.AuthenticationType);
// Displays: WindowsIdentity.AuthenticationType: NTLM

??? What does this say?

Also, how does one enable delegation as opposed to impersonation?

Thanks for your help. We appreciate it.

Mark
fi******@umn.edu
"bruce barker" <no***********@safeco.com> wrote in message
news:et**************@TK2MSFTNGP12.phx.gbl...
to pass the users credentials to the sqlserver (on a different box),
delegation is required. ntlm does support delegation. only basic (which
gives iis a primary token which is allowed 1 hop) and digest (if delegation is enabled) support passing user creditals from the iis box to a different
box.

-- bruce (sqlwork.com)
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:#V**************@TK2MSFTNGP12.phx.gbl...
We are attempting to use impersonation to connect from our ASP.NET website to a SQL Server on the same domain. The code below works just fine in our web.config file:

<identity impersonate="true" userName="mydomain\mylogin"
password="whatever">

However, if we attempt to impersonate the user that currently is logged in to the client computer using ...

<identity impersonate="true">

we get the error message:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

I'm an SA on the SQL Server box ... something else isn't quite clicking.
Any recommendations? In IIS we have Integrated Windows Authentication
checked, and nothing else.

Thanks in advance.

Mark
fi******@umn.edu



Nov 18 '05 #4
Curt,

I'm not sure if this is good news, BUT it did work when I checked Basic. In
fact, it worked when I had Basic checked both with and without integrated
checked.

What does this mean? The thought of needing basic does not sound good on
the surface, but I'm no IIS guru.

Thanks!

Mark

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
just as a test, try Basic instead of Integrated auth once....

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
We are attempting to use impersonation to connect from our ASP.NET website to a SQL Server on the same domain. The code below works just fine in our web.config file:

<identity impersonate="true" userName="mydomain\mylogin"
password="whatever">

However, if we attempt to impersonate the user that currently is logged in to the client computer using ...

<identity impersonate="true">

we get the error message:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

I'm an SA on the SQL Server box ... something else isn't quite clicking.
Any recommendations? In IIS we have Integrated Windows Authentication
checked, and nothing else.

Thanks in advance.

Mark
fi******@umn.edu



Nov 18 '05 #5
write out the user that the system thinks you are when you use Integrated.
It may be as simple as "user" vs "domain\user"

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Curt,

I'm not sure if this is good news, BUT it did work when I checked Basic. In fact, it worked when I had Basic checked both with and without integrated
checked.

What does this mean? The thought of needing basic does not sound good on
the surface, but I'm no IIS guru.

Thanks!

Mark

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
just as a test, try Basic instead of Integrated auth once....

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
We are attempting to use impersonation to connect from our ASP.NET website to a SQL Server on the same domain. The code below works just fine in our web.config file:

<identity impersonate="true" userName="mydomain\mylogin"
password="whatever">

However, if we attempt to impersonate the user that currently is logged
in
to the client computer using ...

<identity impersonate="true">

we get the error message:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

I'm an SA on the SQL Server box ... something else isn't quite

clicking. Any recommendations? In IIS we have Integrated Windows Authentication
checked, and nothing else.

Thanks in advance.

Mark
fi******@umn.edu




Nov 18 '05 #6
Curt,

I tried:
System.Security.Principal.WindowsIdentity.GetCurre nt().Name
which should display the impersonated user. With or without the Basic
checked, it displayed the domain/user.

What does this imply? Thanks again.

Mark
fi******@umn.edu

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
write out the user that the system thinks you are when you use Integrated.
It may be as simple as "user" vs "domain\user"

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Curt,

I'm not sure if this is good news, BUT it did work when I checked Basic.

In
fact, it worked when I had Basic checked both with and without integrated
checked.

What does this mean? The thought of needing basic does not sound good on the surface, but I'm no IIS guru.

Thanks!

Mark

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
just as a test, try Basic instead of Integrated auth once....

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
> We are attempting to use impersonation to connect from our ASP.NET

website
> to a SQL Server on the same domain. The code below works just fine in
our
> web.config file:
>
> <identity impersonate="true" userName="mydomain\mylogin"
> password="whatever">
>
> However, if we attempt to impersonate the user that currently is logged
in
> to the client computer using ...
>
> <identity impersonate="true">
>
> we get the error message:
>
> Login failed for user '(null)'. Reason: Not associated with a

trusted SQL
> Server connection.
>
> I'm an SA on the SQL Server box ... something else isn't quite

clicking. > Any recommendations? In IIS we have Integrated Windows

Authentication > checked, and nothing else.
>
> Thanks in advance.
>
> Mark
> fi******@umn.edu
>
>
>
>
>
>



Nov 18 '05 #7

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

Similar topics

12
by: Nils M. Lunde | last post by:
Hi! I've made a Web Service using C# that is using impersonation. The WS is working fine on WinXP and Win2003Server, but I'm having problem getting it to work on Win2000. The problem is that...
1
by: Angelo Castigliola III | last post by:
I am trying to write to the registry of a remote computer that is not on a domain from a computer that is on a domain. I am trying to impersonate an administrator account that is on this remote...
2
by: Divya | last post by:
Hello, I am developing a simple move file utility to move files from one domain to another in the same internal network. My program runs fine when it reads the parameters (user, domain, password...
6
by: Erez Shor | last post by:
Hi, I need to build and asp page which access a remote windows server's registry and create a registry key. In order for the ASP page to be able to access the registry on the remote server I need...
8
by: ajamrozek | last post by:
I have an ASPX page that needs to display data from an Access DB that resides on a network resource other than the running server. To access the web page itself, I need IIS to have anonymous login...
1
by: Standist | last post by:
..net supply a Impersonate method. There some question about this method. Can I impersonate a user that exist in a remote computer.
1
by: Steve B. | last post by:
Hi, I'm having difficulties to configure security in a 3 tiers web application. Let's explain the scenario : A. The client computer is running in a domain in which the user is authenticated...
4
by: =?Utf-8?B?QXZhRGV2?= | last post by:
ASP.Net 2. We are migrating to Windows 2008 64 bit Server with IIS 7 from Windows 2003 32 Bit with IIS 6. A few library classes we wrote uses impersonation in code like explained in this...
5
by: WT | last post by:
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...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.