Windows Authentication - How to impersonate a user while developing locally?
I'm inherited an ASP.NET website project where they have used Windows Authentication. The "admin" account that the开发者_开发问答y are testing are on a separate network, and I need to impersonate that account (there is a table in a database that I currently have that holds the admin account's related contents, so I first need to be able to "logged in" as that user in order to see the contents). I've tried to set the web.config like this:
<identity impersonate="true" userName="admin.user" password="admin.pass" />
Where "admin.user" and "admin.pass" are the actual admin's account credentials. However, when I run the site, I received this error message:
Parser Error Message: Could not create Windows user token from the credentials specified in the config file. Error from the operating system 'Logon failure: unknown user name or bad password.
I'm not familiar with Windows Authentication and impersonation so any help would be appreciated.
Thanks.
Host it on IIS and then it should work.
精彩评论