. . Hong Kong Business Software Company
Expert in web-based solutions
Software House in Hong Kong

Microsoft Certified Solution Developer

 

Chief Architect's Blog on software development

3 April 2008
Database Security and Process Identity
From time to time, I saw questions in various forums asking why he/she (as an administrator) cannot use database resources with ASP.Net application. You may see an error message similar to the following:

Cannot open database "DatabaseName" requested by the login. The login failed. Login failed for user 'ComputerName\ASPNET'.

In fact, web-based applications are running under the process identity (usually ASPNET on Windows XP and NETWORK SERVICE on Windows Vista, Windows Server 2003 and Windows Server 2008). Process identities is Windows account of your ASP.Net application. You need to give permission to this account for using the database if your are using Windows Authentication in your database. If your database use SQL Authentication, your database checks against your supplied user name and password and, therefore, process identity is not checked.

Caller's identity is the identity of the person using the application. You can give different permissions to the caller according to his/her role. However, if your base application does not have permission to access the database, your application has no way to assign permission to the caller for using the database.