> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/penetorshontesuto/configure-a-pentest/setting-up-authenticated-testing/handling-two-factor-authentication-totp.md).

# 二要素認証（TOTP）への対応

AikidoのAIエージェントは、認証済みスキャン中に2FA画面を回避するための有効な時刻ベースのワンタイムパスワード（TOTP）を生成できます。

**アプリケーションが以下を必要とする場合は、この機能を使用してください：**

* **認証アプリ：** ログインフローでは、Google Authenticator、Authy、1Password などの6桁コードが求められます。

{% hint style="info" %}
アプリがメールでコードを送信する場合は、 [メール認証機能](/docs/docs-ja/penetorshontesuto/configure-a-pentest/setting-up-authenticated-testing/handling-email-verification-and-magic-links.md).

アプリがSMSコードを使用している場合は、 [SMS認証](/docs/docs-ja/penetorshontesuto/configure-a-pentest/setting-up-authenticated-testing/handling-sms-verification.md).
{% endhint %}

### 仕組み

スマートフォンでQRコードをスキャンする代わりに、未加工の **シークレットキー** （または `otpauth://` URI）をアプリケーションから抽出し、Aikidoに貼り付けます。エージェントはこのシークレットを使って、スキャン中に有効なコードをその場で数学的に生成します。

### セットアップガイド

{% stepper %}
{% step %}
**シークレットキーを見つける**

対象アプリケーションの2FA設定画面に移動します（通常はここでQRコードをスキャンします）。

1. 次の文言のテキストリンクを探します： **「QRコードをスキャンできませんか？」**, **「スキャンでお困りですか？」**、または **「セットアップキーを表示」**.
2. クリックすると、プレーンテキストのコード（シークレットキー）が表示されます。
3. この文字列をコピーします（例： `4IKIDOI5AW35OME`).

<div data-with-frame="true"><figure><img src="/files/c516710991c36bafdb74154c5001504b604e5f0c" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**Aikidoを設定する**

Aikidoの **認証セット** モーダル：

1. 以下までスクロールして **TOTP設定** セクションで指定できます。
2. シークレットキー（または完全な `otpauth://` URI）を入力欄に貼り付けます。
3. システムが直ちに形式を検証します。

<div data-with-frame="true"><figure><img src="/files/ea4fd987457399fe8574abb1f00cf1cc4b620b6d" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**ログインロジックを更新する**

コードを入力するタイミングをエージェントに明示的に指示する必要があります。

**手順例：**

```
1. https://app.example.com/login に移動する
2. ユーザー名を入力：admin
3. パスワードを入力：abc123
4. 「ログイン」をクリックします
5. 2FA画面が表示されたら、TOTPコードを生成して検証フィールドに入力します。
6. 「Verify」をクリック
```

{% endstep %}

{% step %}
**設定をテスト**

エージェントがコードを正しく生成して入力できることを確認します：

1. クリック **保存してテスト**.
2. エージェントがブラウザーセッションを起動します。
3. 再生ログを確認し、エージェントが2FAプロンプトを正常に回避してダッシュボードに到達したことを確認します。

<div data-with-frame="true"><figure><img src="/files/726ecb94de086b9f6e89ac02a9b6f7c822bf8512" alt=""><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/docs/docs-ja/penetorshontesuto/configure-a-pentest/setting-up-authenticated-testing/handling-two-factor-authentication-totp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
