Re: Accessing Remote SQL 2000 with a proxy account

From: Marina Gofman (marinagofman@hotmail.com)
Date: 06/28/02


From: "Marina Gofman" <marinagofman@hotmail.com>
Date: Fri, 28 Jun 2002 08:39:21 -0700


Hi,
I am thinking along the same lines, but I was wondering
what is going on?
Where and when does the token get formed?
Is it done on the .NET framework level or IIS?
If it is IIS, then how can I create the scenario I have in my ASP app: set
anonymous user to a valid network account
with corresponding login and a password, so it can go against SQL a this
user, who has corresponding permissions in SQL?
Any ideas?

"Arild Bakken" <arildb_@hotmail.com> wrote in message
news:O0i2mvmHCHA.2208@tkmsftngp13...
> Hi,
>
> I've hade much the same problem. The thing is that even if you are using
> impersonation, the webserver cannot delegate your security token to
another
> computer. It supposed to be possible to turn on delegation, but I've never
> got it to work.
>
> Arild
>
> "Marina Gofman" <marinagofman@hotmail.com> wrote in message
> news:eRa050iHCHA.2272@tkmsftngp09...
> > Hello,
> > I am just starting with .NET and here is my problem:
> > I have Windows 2000 (IIS 5) and .NET app on one box.
> > I am trying to run a simple select query on a remote SQL 2000 server
with
> > Windows security.
> >
> > So far I cannot connect and get the error: Login failed for user
> > 'domain\username' - (I am using a proxy account)
> >
> > Any suggestions on how to resolve it would be greatly appreciated.
> >
> > I changed <processModel > in machine.config : userName=system.
> > I also changed web.config to include the impersonation tag with the
userID
> > and a password that have reading rights in the DB
> > (checked it out with the different app)
> >
> > Another thing that I reset was the security on the app in IS manager to
> > integrated in order to debug.
> >
> > Here are the related code snippets:
> >
> > private void Button1_Click(object sender, System.EventArgs e)
> >
> > {
> >
> > SqlConnection myConnection = new
> > SqlConnection("server=abc;database=mmm;Trusted_Connection=yes");
> >
> > SqlDataAdapter myCommand = new SqlDataAdapter("select * from
> tLocation_Dim",
> > myConnection);
> >
> >
> > DataSet ds = new DataSet();
> >
> > myCommand.Fill(ds);
> >
> > DataGrid1.DataSource = ds.Tables[0].DefaultView;
> >
> > DataGrid1.DataBind();
> >
> > }
> >
> > private void Button2_Click(object sender, System.EventArgs e)
> >
> > {
> >
> >
> > SqlConnection oConnection = null;
> >
> > System.String gsConnectionString;
> >
> > gsConnectionString = "server=abc;database=mmm;Trusted_Connection=yes";
> >
> > oConnection = new SqlConnection(gsConnectionString);
> >
> > oConnection.Open();
> >
> >
> >
> > System.String sSQL;
> >
> > sSQL = "select * from tLocation_Dim";
> >
> > SqlCommand oCommand = new SqlCommand(sSQL, oConnection);
> >
> > oCommand.CommandType = CommandType.Text;
> >
> >
> > SqlDataAdapter oDa = new SqlDataAdapter();
> >
> > DataSet oDs = new DataSet();
> >
> > oDa.SelectCommand = oCommand;
> >
> > try
> >
> > {
> >
> >
> >
> > oDa.Fill(oDs, "DataSet");
> >
> > }
> >
> > catch (Exception ee)
> >
> > {
> >
> > throw new Exception("An exception occured in Button2_click", ee);
> >
> > }
> >
> > finally
> >
> > {
> >
> > // Update Output Parameters
> >
> >
> > }
> >
> >
> > }
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>