简体   繁体   English

https站点的登录脚本

[英]Login script for https site

Is it possible to auto-login to a https enabled site by clicking a link? 通过单击链接是否可以自动登录到启用https站点?

So far i have tried php and powershell with no success. 到目前为止,我已经尝试了phppowershell ,但均未成功。 Curl does not return anything, the page is just loading with no visible response. Curl不返回任何内容,该页面仅在加载时没有可见的响应。

In the good old Days the trick user:password@www.site.com worked fine, but now with all the security updates in Explorer this is not allowed. 在过去的好日子里,欺骗user:password@www.site.com工作,但是现在在Explorer中所有安全更新都不允许这样做。

When accessing my site i get a popup window asking for username and password (looks like iexplorer is creating that popup) so login fields are not in the browser window. 访问我的网站时,我会看到一个弹出窗口,询问用户名和密码(看起来像iexplorer正在创建该弹出窗口),因此登录字段不在浏览器窗口中。

As i said i have tried curl, but how do i know the field names for username and password ? 如我所说,我尝试过curl,但是我怎么知道usernamepassword的字段名呢? Do they have standard names? 他们有标准名称吗? The text in the popup is in Swedish, but it is an English site i am accessing. 弹出窗口中的文本为瑞典语,但这是我正在访问的英语站点。 Therefor i assume the fields have standard names. 因此,我认为这些字段具有标准名称。

Any ideas? 有任何想法吗? preferably an working example :) 最好是一个工作示例:)

You can pass the user/password of Basic Authorization using -u parameter. 您可以使用-u参数传递基本授权的用户名/密码。 And for https use the -k for insecure connection. 对于https使用-k进行不安全的连接。

curl -X POST -L -k
  -u "username:password"
  -d "id=10&name=alex"
  "https://www.example.com/"

For other curl parameters check this curl manual . 有关其他卷曲参数,请参阅卷曲手册

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM