Home » .NET 4.0 » VB.NET – User Impersonation

VB.NET – User Impersonation

Application Error:

“ASP.NET  v4.0” does not have the authority to perform the requested command or operation.”

Problem:

ASP.NET  v4.0 application has no right to access DB2 database with default application user.

Solution:

  1. Login on to server where your application is hosted
  2. Create new local user account (myuser, myusrpwd)
  3. Add myuser account to DB2ADMNS, DB2USERS and IIS_IUSRS groups
  4. Open IIS Manager (Start – inetmgr – Enter)
  5. Select Default Web Site
  6. In Default Web Site Home screen, double click Authentication
  7. Right-click ASP.NET  Impersonation and Enable it. Right-click it again and Edit it. Check Specific User: and click Set… button. Enter username and password for the specific user (myuser). Click OK.

<identity impersonate="true" password="myurspwd" userName="myuser" />

  1. Save and x-out Web.config file.
  2. Build and Publish your application.