Advertisement

03.05.2004 at 06:45AM PST, ID: 20908294
[x]
Attachment Details

ASP.NET SQL Server Connection Using Integrated Security=SSPI

Asked by etlrdbl in .NET

Tags: integrated, security, sql, sspi, connection


Hi, I need to know whether it is possible to use integrated security to connect to an instance of sqlserver that exists on a separate server to IIS.  I need the connection to impersonate the current user. This is for an intranet on a secured network.

I have IIS6 on windows2003 server and SQLServer2000 on windows2000 server.  

Here's what I know so far:
1) I can successfully achieve this when the sql server is on the same box as IIS.
2) If I use the same code to connect to an instance of sql server on a different box the connection tries to use the 'NT AUTHORITY\ANONYMOUS LOGON' account.  There one peculiarity with this: if I run the web site from the web (IIS) server then it WILL impersonate my account when connecting.
3) I have read that using TCP/IP instead of pipes may enable this to work.  I have no understanding of what this really means.
4) Most of the sites I have looked at do not say that it is impossible to achieve this.  In general they say it is easy when sql server is on the same box (which I agree with) and just that if SQL Server is on another box it is "more difficult".

If you know this is possible and can tell me how I can achieve this then I will double the point allocated.  However if the answer is just that it isn't possible then that will be great (it will put me out of my misery)


Code details:
my connection string: "Integrated Security=SSPI;Data Source=testbox;Initial Catalog=test;
web.config setting:
<identity impersonate="true"/>
<authentication mode="Windows"/>Start Free Trial
 
Loading Advertisement...
 
[+][-]03.05.2004 at 07:03AM PST, ID: 10523244

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.05.2004 at 07:10AM PST, ID: 10523306

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.05.2004 at 07:22AM PST, ID: 10523417

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: .NET
Tags: integrated, security, sql, sspi, connection
Sign Up Now!
Solution Provided By: mikkelp
Participating Experts: 1
Solution Grade: B
 
 
[+][-]03.05.2004 at 07:36AM PST, ID: 10523557

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32