> For the complete documentation index, see [llms.txt](https://docs.authgear.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.authgear.com/authentication-and-access/authentication/passwords/password-policy.md).

# Password Policy

Setting format and strength requirements for passwords

Authgear allows you to set a password policy for your project. This page walks through setting password requirements, password strength, keywords to exclude, and password expiry from the Authgear Portal.

You can configure your password policy in password settings.

## 1. Password Requirements

Choose a minimum character length, and use the checkboxes provided to include one or more requirements for a valid password.

<figure><img src="https://2638622528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAjXpMovvVxeIY33s_K%2Fuploads%2Fgit-blob-cba1ba8ae4ed6bed1d2b5763f0f73dd515db76bb%2FScreenshot%202025-08-05%20at%2015.22.53.png?alt=media" alt=""><figcaption></figcaption></figure>

To ensure your updated password policy applies to both existing and new users, toggle on "Force password change on next login". All users will be required to update their passwords if their current passwords do not meet the newly configured policy.

## 2. Password Strength

#### What is password strength?

Password strength is simply a measure of how difficult it is to guess or crack a password.

Authgear currently uses the [zxcvbn](https://github.com/dropbox/zxcvbn) password strength estimator library, which goes beyond basic requirements (like length or character variety) and uses pattern matching to recognize common insecure passwords.

<details>

<summary>How password strength is calculated in Authgear</summary>

A password is scored for how uncommon and guessable it is using the zxcvbn algorithm.

The following table shows the scores for the various minimum password strength levels in Authgear.

| Password Strength Level | Score | Description                                                                                                         |
| ----------------------- | ----- | ------------------------------------------------------------------------------------------------------------------- |
| N/A                     | -     | Totally ignore the Advance password strength score and use the Basic password policy. E.g. Minimum password length. |
| Extremely guessable     | 0     | Too guessable: risky password. (guesses < 10^3)                                                                     |
| Very guessable          | 1     | Very guessable: protection from throttled online attacks. (guesses < 10^6)                                          |
| Fair                    | 2     | Somewhat guessable: protection from unthrottled online attacks. (guesses < 10^8)                                    |
| Very unguessable        | 3     | Safely unguessable: moderate protection from offline slow-hash scenario. (guesses < 10^10)                          |
| Extremely unguessable   | 4     | Very unguessable: strong protection from offline slow-hash scenario. (guesses >= 10^10)                             |

</details>

### How to set password strength for your Authgear project

Scroll down to the Advanced sub-section of the Password tab, then click select your preferred option from the **Min. password strength level** dropdown.

<figure><img src="https://2638622528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAjXpMovvVxeIY33s_K%2Fuploads%2Fgit-blob-aed78f8a1a45aa9bd18881901c0a38849e6fe7c1%2FScreenshot%202025-08-05%20at%2015.35.39.png?alt=media" alt=""><figcaption></figcaption></figure>

## 3. Prevent Password Reuse

Toggle on **Prevent Password Reuse** to ensure a new, unique password is set during password changes.

In the following example, the new password cannot match any password used within the 90 days, or any last 3 previously used passwords.

<figure><img src="https://2638622528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAjXpMovvVxeIY33s_K%2Fuploads%2Fgit-blob-39588c33333ea9d4ba246aed6fa6d87bde434b30%2FScreenshot%202025-08-05%20at%2015.37.33.png?alt=media" alt=""><figcaption></figcaption></figure>

## 4. Keywords to be Excluded from Password

You can also disallow specific keywords in the user's password. Simply add them to the "Keywords to be excluded" field, and the admin or user will not be able to set a password containing the listed keywords.

<figure><img src="https://2638622528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAjXpMovvVxeIY33s_K%2Fuploads%2Fgit-blob-4ff5fffd7148fc1137b366ccf77d839593f36235%2FScreenshot%202025-08-03%20at%2020.10.50.png?alt=media" alt=""><figcaption></figcaption></figure>

## 5. Password Expiry

See [Password Expiry](/authentication-and-access/authentication/passwords/password-expiry.md)

Once you're done, remember to hit **Save** to keep your changes.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.authgear.com/authentication-and-access/authentication/passwords/password-policy.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
