在BASH中使用CURL登录CAS服务器

在BASH中使用CURL登录CAS服务器,bash,curl,login,cas,Bash,Curl,Login,Cas,我在bash命令行中使用curl登录CAS服务器时遇到问题。CAS服务器不想让我进去。在互联网上搜索了几个小时后,我以这样的脚本结束,但它仍然不起作用: curl -A "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" --cookie cjar --cookie-jar cjar --data "username=username" --data "password=password" --data "_eventid=submit" --data

我在bash命令行中使用curl登录CAS服务器时遇到问题。CAS服务器不想让我进去。在互联网上搜索了几个小时后,我以这样的脚本结束,但它仍然不起作用:

curl -A "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" --cookie cjar --cookie-jar cjar --data "username=username" --data "password=password" --data "_eventid=submit" --data "submit=LogIn" --location "https://website.com/cas/login">/tmp/tmp.html
登录页面看起来很简单,它有2个文本字段和subbmit按钮。在底部,我发布了一个页面的源代码(没有表格、徽标、段落等)。如果有人有什么想法,我将非常感激

<form id="fm1" class="fm-v clearfix" action="/cas/login;jsessionid=1B6E23A2038EA3C179126B90B1E4AE3F" method="post">
<label for="username">Login</label>
<input id="username" name="username" class="field" tabindex="1" accesskey="p" type="text" value="" size="25"/>
<label for="password">Password</label>
<input id="password" name="password" class="field" tabindex="2" accesskey="h" type="password" value="" size="25"/>
<input class="button" name="submit" accesskey="l" value="LogIn" tabindex="4" type="submit" />
<script type='text/javascript'>
document.getElementById("fm1").username.focus();
</script>
<input type="hidden" name="lt" value="_c95FE928E-467E-90BA-1B1A-88A86C1DBE7B_k999794A8-58CC-0845-DC1A-1C6C5C6F978B" />
<input type="hidden" name="_eventId" value="submit" />
</form>

登录
密码
document.getElementById(“fm1”).username.focus();
lt和eventId是身份验证过程中使用的字段