开发者

Windows Authentication - How to impersonate a user while developing locally?

开发者 https://www.devze.com 2023-01-29 13:30 出处:网络
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 t

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消