如何强制基于 IE 的 Web 浏览器控件使用特定的身份验证凭据?
我有一个带有嵌入式 Web 浏览器控件的 WPF C# 客户端应用程序。我已准备好所有适当的挂钩,以便如果我正在浏览的网站需要身份验证,我会处理 IAuthenticate 并传入所需的凭据(用户已经登录到客户端应用程序本身)。这很好用,除了...
如果用户“Bob”通过 IE 访问该网站并输入他的用户名和密码,那么有人使用客户端应用程序并以“Steve”身份登录,“Bob”的会话仍然经过身份验证,并且该网站从不要求新的凭据,因此客户端以“Bob”身份连接。
我真正想做的是每次嵌入式浏览器连接到此站点时,我想发送凭据并强制浏览器和站点使用这些凭据。
有什么想法吗?
请注意,当我需要模拟不同的用户时,这在测试过程中更成为一个问题。
I have a WPF C# client app with an embedded webbrowser control. I have all of the proper hooks in place so that if the site I'm browsing to requires authentication, I handle the IAuthenticate and pass in the required credentials (the user has already logged in to the client app itself). That works great, except...
If user "Bob" visits the site through IE and enters his username and password, then someone uses the client app and logs in as "Steve", "Bob"s session is still authenticated and the site never asks for new credentials, so the client connects as "Bob".
What I really want to do is every time the embedded browser connects to this site, I want to send the credentials and force the browser and site to use those credentials.
Any ideas?
Note that this is more of an issue during testing when I need to impersonate different users.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 Kerr 凭据
Use Kerr Credentials
您需要做的第一件事是将代理的用户凭据写入 Windows 用户凭据缓存。
然后您需要将信息添加到注册表中。
The first thing you need to do is write the user credentials of the proxy to windows user credentials cache.
then you need to add the info to the registry.