> For the complete documentation index, see [llms.txt](https://dexcore.gitbook.io/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dexcore.gitbook.io/guide/dexcore-guide-zh/modules/outlook-hotmail/features/set-2fa.md).

# Set 2FA

{% hint style="info" %}
**What is 2FA?** 2FA stands for **Two-Factor Authentication**. It's an extra layer of security — in addition to your password, you also need a temporary code generated from a secret key. This makes your account much harder to hack.
{% endhint %}

***

## Before You Start

{% hint style="warning" %}
**You MUST complete this step BEFORE setting up 2FA:**

* ✅ Set Recovery Email — 👉 [Set Recovery Email](/guide/dexcore-guide-zh/modules/outlook-hotmail/features/set-recovery-email.md)

2FA requires a Recovery Email to be set first. If you haven't set it yet, do that before continuing.
{% endhint %}

***

## How It Works

1. The bot logs into your Outlook account.
2. It enables 2FA and generates a **2FA key** (a long secret code like `JBSWY3DPEHPK3PXP`).
3. The 2FA key is saved in the **2FA column** of your task file.
4. A **Recovery Code** (backup code) is also generated and saved in the **Recovery Code** column.

{% hint style="info" %}
**What is a 2FA key?** It's a secret code that generates temporary login codes (called **OTP** — One-Time Passwords). To get a temporary code from your 2FA key, use [2fa.live](https://2fa.live) — paste your key there and it will give you a 6-digit code.
{% endhint %}

{% hint style="info" %}
Sometimes recovery codes are not generated for certain accounts. This is normal and does not mean anything went wrong.
{% endhint %}

<figure><img src="https://1894273557-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FICq6a1NJxZLW9ax1Jh21%2Fuploads%2Fgit-blob-ff36952d09bb158195943f40766f045d5ccb9c60%2Fset-2fa.png?alt=media" alt=""><figcaption></figcaption></figure>

***

## After 2FA is Set

{% hint style="danger" %}
**Save your 2FA keys!** If you lose them, you will need your Recovery Email to reset 2FA and set it up again. Always keep backups of your task file.
{% endhint %}

{% hint style="success" %}
**To log into an account manually** (when needed), go to [2fa.live](https://2fa.live), paste the 2FA key from your task file, and use the generated 6-digit code as your login verification.
{% endhint %}

***

## What's Next?

After setting 2FA, continue with:

1. 👉 [Change Password](/guide/dexcore-guide-zh/modules/outlook-hotmail/features/change-security.md) (Change Security → Change Password)
2. 👉 [Set Rule](/guide/dexcore-guide-zh/modules/outlook-hotmail/features/set-rule.md) (forwarding/redirect)

***

## OTP Timeout — `WaitOTPCountMin`

This setting controls how long the bot waits for an OTP code during the 2FA setup process.

**Default: 15 minutes.**

{% hint style="info" %}
**How it works:** The bot waits the set amount of time for the OTP code to arrive. If no code comes within that time, it tries again. Each account gets **3 attempts** total. After 3 failed attempts, the bot logs **"OTP didn't come"** for that account — 👉 [Errors & Info](/guide/dexcore-guide-zh/modules/outlook-hotmail/errors-and-info.md).
{% endhint %}

{% hint style="success" %}
**When to increase this value:** If your IMAP server is slow or overloaded, OTP codes may arrive late. Increase `WaitOTPCountMin` to give the bot more time to wait between retries.
{% endhint %}

***

## Common Mistakes

{% hint style="danger" %}

* ❌ Trying to set 2FA without setting Recovery Email first — **will fail**
* ❌ Losing your 2FA keys (always keep backups of your task file!)
* ❌ Not knowing how to use the 2FA key — go to [2fa.live](https://2fa.live) and paste it there
* ❌ Thinking the Recovery Code is the same as the 2FA key — they are different things
* ❌ Pasting the **6-digit code** from 2fa.live into the 2FA column — paste the **secret key** instead (the long string like `JBSWY3DPEHPK3PXP`). The bot generates codes automatically from the key.
  {% endhint %}
