NickD wrote:
Obviously the way we are told by Microsoft to login to a database is to pur our connection string in the web.config file and to connect to the database as that user every time. Frans supports this just fine, but I'm wondering if anyone logs on to the database with each specific user. Now, I totally understand that in a web environment, you'll have people that are anonymous users. But, in my specific scenario, I know each person that will be logging in to the system because only pre-authorized people will be logging in. Therefore, I could use specific credentials to connect to the database, which is how I currently do things in my thick client app. Are there any pitfalls to this and or any reasons why I shouldn't do things this way? From the way I see it initially, I know then who is on the system by doing a sp_who on the back end, I can keep all my "update_user" and "insert_user" column triggers in place, and I can keep the same permissions that I already have set up. Seems like a win win to me.
I assume you mean using NT Authentication in your connection string and using Windows Authentication in your web app.
I think this is perfectly acceptable way to do security for an Intranet app where all the users already have windows domain accounts.
The main downside I see to this is that you users have access to the SQL Server data directly and could connect to the server and query data. Of course, this is why so many people advocate data access only via SP's cause the SP can control what data the user is able to access cause querys are controled at the SQL level using SQL security.
However, there are some ways to pass the username to the server that your triggers can use and still only grant access to the ASP.net worker process rather than using impersonation.
BOb