> 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-cn/pei-zhi/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-cn/pei-zhi/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.
