使用 Windows 身份验证时如何模拟另一个 Windows 用户?
我有一个 ASP.NET 应用程序,其中只有通过 Windows 身份验证的用户(即登录用户)才能访问大多数页面。现在,我的客户希望能够通过此应用程序使用自定义登录对话框/页面“登录”。
身份验证是实现此目的的方法吗?我该如何进行?
I have an ASP.NET application where only users authenticated by Windows (i.e. logged on user) have access to most pages. Now, my client wants to be able to 'log on' through this app, with a custom login dialogue/page.
Is Authentication the way to achieve this, and how do I go about it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用表单身份验证有什么问题?
如果您还需要模拟,您可以将 web.config 中的
identity
元素中的impersonate
属性设置为 true,但从您提到的情况来看,它不需要听起来你根本不需要模仿。What's wrong with using Forms Authentication?
You can set the the
impersonate
attribute in theidentity
element in your web.config to true if you need impersonation as well, but from what you've mentioned, it doesn't sound like you need impersonation at all.您可以创建一个界面来接受您的用户登录信息并使用以下内容创建新凭证:
并使用此凭证来访问您的安全资源。
You can create an interface to accept your user login info and to create a new crdential with this:
And use this credential to access your secured resource.