フォーラムに 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