> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/zh-tw/she-ding/overleaf-toolkit/password-restrictions.md).

# 密碼限制

使用原生 Overleaf 登入系統進行驗證時，可以對使用者帳號強制套用密碼限制。

{% hint style="info" %}
可以 **不要** 對 SSO（LDAP/SAML 2.0）登入強制套用密碼限制。這些必須在您的身分識別提供者（IdP）中設定。
{% endhint %}

若要啟用密碼限制，請在 Toolkits 中設定相關的環境變數 `config/variables.env` 檔案。

| 名稱                                        | 說明                                                                                                                                                                                                                                                               |   預設 |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---: |
| `OVERLEAF_PASSWORD_VALIDATION_MIN_LENGTH` | 該 **最小** 長度要求。                                                                                                                                                                                                                                                   |  `8` |
| `OVERLEAF_PASSWORD_VALIDATION_MAX_LENGTH` | 該 **最大** 長度允許值。                                                                                                                                                                                                                                                  | `72` |
| `OVERLEAF_PASSWORD_VALIDATION_PATTERN`    | <p>用於驗證密碼 <strong>強度</strong>:</p><ul><li><code>abc123</code> – 密碼需包含 3 個字母和 3 個數字，且長度至少為 6 個字元</li><li><code>aA</code> – 密碼需包含大小寫字母，且長度為 2 個字元</li><li><code>ab$3</code> – 必須包含字母、數字與符號，且長度為 4 個字元</li><li>字元共有 4 種組別：字母、大寫字母、數字、符號。凡不是字母也不是數字的都視為符號。</li></ul> |    — |


---

# 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://ayakaleaf-pro.ayaka.space/on-premises/zh-tw/she-ding/overleaf-toolkit/password-restrictions.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.
