我正在尝试登录一个将 xenForo 用于他们的论坛的页面。不用两步验证也可以正常登录,但是如果用户使用了两步验证,是否可以完成登录?
这是必要的 HTML
<form action="login/two-step" method="post" class="xenForm AutoValidator" data-redirect="yes">
<input name="code" id="ctrl_totp_code" class="textCtrl" type="text">
<label><input name="trust" value="1" type="checkbox"> Trust this device for 30 days</label>
<dd><input name="save" value="Confirm" accesskey="s" class="button primary" type="submit"></dd>
<input name="provider" value="totp" type="hidden">
<input name="_xfConfirm" value="1" type="hidden">
<input name="_xfToken" value="" type="hidden">
<input name="remember" value="0" type="hidden">
<input name="redirect" value="https://www.WEBSITENAME.net/" type="hidden">
</form>
这是我尝试过的:
Document twoStepDoc = Jsoup.connect("https://www.WEBSITENAME.net/login/two-step")
.data("cookieexists", "false")
.data("code", code) //code is a String of my 2-step code I'm testing
.data("trust", "1")
.data("_xfConfirm", "1")
.data("_xfToken", "")
.data("remember", "0")
.cookies(loginForm.cookies())
.post()
;
现在是深夜/清晨,我现在正在尝试任何事情:P