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
-
Incorrect syntax near 'Calculation'.
by ramdhavepreetam (3 replies)
-
User does not have permission to perform this action error
by James Crowley (6 replies)
-
Menu object in ASP.net 1.1?
by Chantcd_com (0 replies)
-
Media Streaming in asp .net
by alohamora (0 replies)
-
DSN Connection
by AaronHudson (0 replies)
Related jobs
-
Microsoft .Net Architect
in AMSTERDAM (€50K-€90K per annum) -
Microsoft Dynamics CRM Technical Consultant
in Netherlands (€50K-€90K per annum)
Events coming up
-
Oct
14
What’s New in Visual Studio 2008 Service Pack 1?
Birmingham, United Kingdom
“Service Pack? We’re calling it a Service Pack? Are you kidding??!?!” Visual Studio 2008 Service Pack 1 will release later in 2008 alongside .NET Framework V3.5 Service Pack 1 and, together, they represent a significant upgrade to Visual Studio 2008. There are enhancements across many areas of the .NET Framework such as data access, windows application development and web development and there are also corresponding changes in the development environment to support the new framework features.
Comments
Leave a comment
Sign in or Join us (it's free).