Trusted Connection to SQL-Server by impersonate a user

  • Thread starter =?iso-8859-1?Q?Jan_Weing=E4rtner?=
  • Start date
?

=?iso-8859-1?Q?Jan_Weing=E4rtner?=

Hi.

I use the example for "WindowsIdentity.Impersonate" to impersonate a user.
This works fine, but if i try to connect to the SQL-Server via trusted
connection (Security=SSPI) the connection is using the _actual_ but not
the impersonated user.
How can i connect to the SQL-Server via SSPI as another user?

thanks,
Jan
 
P

Pablo Castro [MS]

Hi Jan,

That should be enough. Are you calling Impersonate() before
connection.Open() or after that (e.g. before execute)? How do you obtain the
token handle for the user you're impersonating? What version of Windows are
you using?

--
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.

This posting is provided "AS IS" with no warranties, and confers no rights.
 
?

=?iso-8859-1?Q?Jan_Weing=E4rtner?=

That should be enough. Are you calling Impersonate() before

Of course not!

Thanks,
Jan
 
?

=?iso-8859-1?Q?Jan_Weing=E4rtner?=

Hi.

Does SQL server login with impersonation also work via VPN?
Assuming i establish a VPN to a server in the internet. Can i
impersonate another user on this server and connect as this
other user to the SQL server?

thanks,
Jan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top