Reputation: 1174
What's the preferred (best practice) means of connecting an ASP.Net Website to a database? I doubt it's as simple as using Trusted-Connection and giving the NT-Authority accounts access.
What do y'all do? Assuming a clean install of SQL Server (2008), what do you do to configure access to the database for a website?
Upvotes: 2
Views: 439
Reputation: 46879
I also use SQL Server accounts, just find it simpler to do and to troubleshoot.
Upvotes: 0
Reputation: 532745
I used to use trusted connections, but ended up feeling that that sometimes I ended up having to grant too many privileges to the service account used for the connection/app pool. Now I use SQL Server accounts and set up the application to encrypt the connection strings during Application_Start if they aren't already encrypted. In fact I encrypt any section that may contain user credentials. I use an appSetting to determine whether the encryption code runs so I don't encrypt my settings in the development environment.
Upvotes: 0
Reputation: 422280
I usually run ASP.NET app pool as a separate account (not NT AUTHORITY\NETWORK SERVICE
) and use Windows authentication to access the SQL Server. This method has the advantage of not storing the password in config files.
Steps:
This will work for many apps. For more complex security environments, you might need more sophisticated strategies.
Upvotes: 1