tags:

views:

185

answers:

1

Hello,

If I have an application (on C#) that runs under a user context (ex. DOMAIN\StandardUser) which makes a call to a Web Service, which has the web service worker process running under a different context (ex. DOMAIN\WebServiceUser), and that web service connects to a SQL database, which user context does the database connect from, the StandardUser or the WebServiceUser?

Thanks,

+2  A: 

use integrated security, so your user context will also use for web service.

Syed Tayyab Ali
So your saying that when the web service is called it impersonates the user to the database connection, and does not connect to the database from it's own context, correct? And yes, it's using integrated security.
Phillip
No, the logged in user for the database connection is "DOMAIN\WebServiceUser" because the web service connects to the database. Not your app.
gbn
you can use web.config file, where you can place database user name and password. in that way, you dont need any context user name for database connection.
Syed Tayyab Ali
Syed Tayyab Ali: Thats what were are doing already but we are using it under SQL Authentication which we are trying to get away from. If we can use integrated security that would be preferred. We just need to make sure what context gets permissions.It sounds like the web service context is used which is what we wanted. Thanks gbn!
Phillip