[英]How to do Auto authentication for automatically login to website?
I need to get automatically login to website from my windows application. 我需要从Windows应用程序自动登录网站。 I am doing it with HttpWebRequest but what i want is to
我正在用HttpWebRequest来做,但是我想要的是
Reason : I don't want to enter user name and pasword, i just want to click button and any browser(default browser) open with index page (page after login) 原因 :我不想输入用户名和密码,我只想单击按钮,然后使用索引页面(登录后的页面)打开任何浏览器(默认浏览器)
Normal Example : 正常示例:
What to Do ? 该怎么办 ?
Hint : 提示:
can anyone help me? 谁能帮我?
I also need to solve the same issue, and the problem is hint point 2 in your list. 我还需要解决相同的问题,问题是您列表中的提示点2。 ie.
即。 how to set a cookie in a browser, without limiting yourself to using a specific broswer.
如何在浏览器中设置Cookie,而又不局限于使用特定的浏览器。 The conclusion I am coming to, is that I need to use a standard 'Single Sign-On' logic, where we update the web-server to use short term tokens such as mentioned here... http://msdn.microsoft.com/en-us/library/ms972971.aspx
我得出的结论是,我需要使用标准的“单点登录”逻辑,在该逻辑中,我们更新Web服务器以使用诸如此处所述的短期令牌…… http://msdn.microsoft。 com / zh-CN / library / ms972971.aspx
In this case the steps would be something like: 在这种情况下,步骤将类似于:
1. In app - Logon with HttpWebRequest. 1.在应用程序中-使用HttpWebRequest登录。
2. Get short-term token (the link suggests validity lifetime of just 2 seconds) 2.获取短期令牌(该链接建议有效期仅为2秒)
3. Open browser with url http://MyWebsite>/SignNn?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxx
3.使用URL
http://MyWebsite>/SignNn?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxx
打开浏览器
4. Next I need to confirm if the SignOn process can return cookies correctly. 4.接下来,我需要确认SignOn进程是否可以正确返回cookie。
I dont think you can solve this in a generic way. 我认为您无法以一般方式解决此问题。
What usually happens in such scenarios is that the form within the web page is submited to web server, the web server reads the user name / password values from the form and authenticates the user against the underlying user managment repository. 在这种情况下,通常发生的情况是将网页中的表单提交给Web服务器,Web服务器从表单中读取用户名/密码值,并根据基础用户管理存储库对用户进行身份验证。
You can write such a solution for specific sites, by analzying with a sniffer the posted form in the authentication pages, and then creating such an http message yourself and sending it to the relevant site. 您可以通过嗅探器在身份验证页面中张贴的表单进行分析,然后自己创建此类http消息并将其发送到相关站点,从而为特定站点编写这样的解决方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.