Library tutorials & articles
SQL Trusted Connections with ASP.NET
Introduction
The problem arises when your SQL server and your IIS/asp.net server are on separate machines, which is a typical setup. As the ASPNET user does not exist on the SQL server you can't grant access to it.
There are 4 main ways to overcome this problem
- Use IIS6 in native application mode
- Mirror the asp.net user on both the IIS box and the SQL server and set a known password
- Use impersonation to change the context your pages run in
- Encrypt a connection string in the registry and forget about trusted connections.
- Switch the asp.net context to be a domain user.
Running any web service as a domain user is ill-advised. A compromise of your web server would mean that any cracker would then have an authenticated session to your domain or active directory and be able to wander outside the web server and through any other machines the user context has access to.
Encrypting and accessing data in the registry is covered by Microsoft Knowledge Base article 329290 and an MSDN article in the Building Secure ASP.NET Applications patterns and practices section.
Both impersonation and mirroring the asp.net user require you to mirror accounts on both the web and SQL server if you are not in a domain/AD environment.
Related articles
Related discussion
-
High-Performance .NET Application Development & Architecture
by Manjot Bawa (0 replies)
-
User does not have permission to perform this action error
by James Crowley (6 replies)
-
Incorrect syntax near 'Calculation'.
by ramdhavepreetam (3 replies)
-
Not able to launch the web application
by NaseemAhmed (0 replies)
-
Research topic in software
by reachsangeethamathew (0 replies)
Related podcasts
-
CodeCast Episode 9: 2008 Year in Review
CodeCast Episode 9: 2008 Year in ReviewOur special 2008 year in review episode with hosts Ken Levy and Markus Egger, joined by special guest co-host Rick Strahl of West Wind Technologies. Topics · Visual Studio (@ 2:37) · Languages (@ 6:28) · SQL Server (@ 10:15) · ...
Events coming up
-
Nov
18
15 Minutes of Fame
Dresher, United States
This is a yearly tradition. We select 10 of the favorite speakers from monthly meetings, code camps, and hands on labs. Each one does a 15 minute talk on their favorite .NET technology. This is our 10th anniversary so we plan a gala event with special prizes and refreshments.
This thread is for discussions of SQL Trusted Connections with ASP.NET.