Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect to SQL Server using windows authentication and specific account

I have an ASP.Net app, that runs using windows authentication. The connection to the SQL Server is usually done by creating a sql server account and using that in the connection string.

However, in this specific very restrictive hosting environment, we have been asked to use a specific WINDOWS/active directory account to connect to the SQL Server.

Please note it is not the windows credentials of the user of the website, we need to connect to the SQL server with - it is one specific windows/AD account.

How do I configure that in my connection-string?

like image 643
Kjensen Avatar asked Feb 21 '11 12:02

Kjensen


1 Answers

Use a connectionstring like this:

Server=YourServer; Database=YourDatabase; Integrated Security=true;

Your program has to run under the account that you need to connect as. You can set the identity of your website in IIS by editing the AppPool.

like image 94
Klaus Byskov Pedersen Avatar answered Sep 19 '22 18:09

Klaus Byskov Pedersen