Integrated Security...

Does anyone know how to impersonate a user and then use integrated security with SQL server? Every place I've looked so far only shows how to use integrated security through IIS. For some reason, everytime I impersonate a user account, SQL server identifies me as "NT AUTHORITY\ANONYMOUS LOGON" Is this by design? or am I doing something wrong?
[346 byte] By [TheCompWiz] at [2008-2-6]
# 1
I don't think that the problem you are seeing is due to SQLServer. This is most likely due to your impersonation configuration in IIS. It looks like the impersonation you are doing is not allowed to go out on network (it is like going LogonUser with LOGON32_LOGON_NETWORK flag), that's why when you connect to SQLserver your identity is not the one you expect to be after impersonation. I recommend reading IIS/ASP.Net documentation on that.
ruslanovechkin at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Security...
# 2

Thanks for your quick response... but one small detail. I'm not using IIS or asp.net. I'm using the traditional "logonuser" API method. Thanks anyway. And, yes... I'm using the LOGON32_LOGON_NETWORK flag.

TheCompWiz at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Security...
# 3

Just to conclude: the problem stems from using the LOGON32_LOGON_NETWORK flag, as Ruslan pointed out.

Thanks
Laurentiu

LaurentiuCristofor at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Security...

SQL Server

Site Classified