cURL无法登录basecamp

cURL无法登录basecamp,curl,login,basecamp,Curl,Login,Basecamp,我正在尝试使用curl登录basecamp并下载附件 但当我卷曲时: curl -F "username=my-user&password=my-pwd" "https://my-domain.basecamphq.com/login" 这不是身份验证。报告指出: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 TRANSITIONAL//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-trans

我正在尝试使用curl登录basecamp并下载附件

但当我卷曲时:

 curl -F "username=my-user&password=my-pwd" "https://my-domain.basecamphq.com/login"
这不是身份验证。报告指出:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 TRANSITIONAL//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <meta name="robots" content="noindex, nofollow" />
  <meta name="csrf-param" content="authenticity_token"/>
<meta name="csrf-token" content="H5w&#47;7j9I5s38oQ9NdVgpkp&#47;QCxIZ3YW+qM&#47;+Hj&#47;ERr0="/>
  <title>My Domain Name.: Sign in</title>
  <script src="https://my-domain.basecamphq.com/rev_28dd107/sprockets.js?651551a0be3439fa32557210a7eea7d7" type="text/javascript"></script>
    <link href="https://my-domain.basecamphq.com/rev_28dd107/application.css" media="screen" rel="stylesheet" type="text/css" />
  <link href="https://my-domain.basecamphq.com/rev_28dd107/stylesheets/print/application.css" media="print" rel="stylesheet" type="text/css" />

  <!--[if IE]><link href="https://my-domain.basecamphq.com/rev_28dd107/stylesheets/ie/base.css" media="screen" rel="stylesheet" type="text/css" /><![endif]-->


    <meta name="queenbee-id" content="1152680" />

  <meta name="return-to-location" content="" />

  <script type="text/javascript">
    if (Login.recoverSessionToken()) {
      Login.clearPersistedTokens();
      window.location = "";
    }
  </script>

</head>

<body class="login">


  <div class="login">
        <h1>My Domain Name.</h1>







<div id="login_dialog" class="login_dialog">
  <form accept-charset="UTF-8" action="https://launchpad.37signals.com/authenticate" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="H5w/7j9I5s38oQ9NdVgpkp/QCxIZ3YW+qM/+Hj/ERr0=" /></div>
    <input id="product" name="product" type="hidden" value="basecamp" />
    <input id="subdomain" name="subdomain" type="hidden" value="my-domain" />

    <div id="user_name_login">
      <h2>Username</h2>
      <input autocapitalize="off" autocorrect="off" id="username" name="username" type="text" /><br/>

      <h2>Password</h2>
      <input id="password" name="password" type="password" /><br/>

        <label><input class="auto" id="remember_me" name="remember_me" type="checkbox" value="1" /> Remember me on this computer</label><br />

      <input class="button" name="commit" type="submit" value="Sign in" />

      <div class="extras">
        <ul>
          <li><strong>Help:</strong> <a href="/amnesia/forgot_password">I forgot my username or password</a></li>
        </ul>
      </div>
    </div>
</form></div>

<script type="text/javascript">
//<![CDATA[
$("username").focus()
//]]>
</script>

  </div>
</body>

</html>

我的域名:登录
if(Login.recoverSessionToken()){
Login.clearPersistedTokens();
window.location=“”;
}
我的域名。
用户名

密码
在这台电脑上记得我吗
  • 帮助:
//
这里出了什么问题?如果有人能帮忙,那就太好了


提前感谢:)

从输出中可以看出,通过basecamp网站登录需要的不仅仅是用户名和密码

至少它需要

  • authenticity\u token=H5w/7j9I5s38oQ9NdVgpkp/QCxIZ3YW+qM/+Hj/ERr0=
但每次访问该页面时,情况都会有所不同

似乎您还需要包括

  • product=basecamp
  • subdomain=mobme
你这样做的目的是什么? 你是在试图截取这个网站吗

我建议您只需查看开发人员API

或者,如果这还不够,请在或中尝试
Mechanize
。 这将创建一个简单的可编写脚本的机器人,加载页面并与之交互,因此您不必担心伪造正确的参数