Skip to content
Select languageEnglish

Password Blacklist Files

Keycloak’s passwordBlacklist password policy rejects any password found in a list you provide. Upload the list as a password blacklist file, then name it in a realm’s password policy.

Password blacklist files are available on every dedicated cluster on a paid plan. Shared trial realms need a dedicated cluster first; uploading to one returns 403.

Your API key needs clusters:password-blacklists:read to list and read files, and clusters:password-blacklists:write to upload and delete them (write includes read).

  • A file is up to 25 MB, plain text in UTF-8 encoding, with one password per line. Keycloak decides how letter case is matched, so after the file is ready, try a listed password in a test realm before relying on it.
  • A cluster holds up to 10 files. An 11th upload returns 422 with the code limit_reached.
  • A name uses letters, digits, dot, dash and underscore only, up to 255 characters. Any other name returns 422.
  • An empty file returns 422.

A file keeps the name and content it was uploaded with. Uploading a name that already exists on the cluster returns 409. To change a list, upload the new content under a new name, point the realm policy at the new name, then delete the old file.

Send a multipart form with the file name, the file and, optionally, apply_now:

curl -X POST "https://api.skycloak.io/clusters/$CLUSTER_ID/password-blacklist-files" \
  -H "API-Key: $SKYCLOAK_API_KEY" \
  -H "API-Version: 2026-06-01.beta" \
  -F "name=common-passwords.txt" \
  -F "file=@common-passwords.txt;type=text/plain"

The response is 201 with the file:

{
  "name": "common-passwords.txt",
  "size": 9231004,
  "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
  "status": "waiting_for_restart",
  "created_at": "2026-11-25T10:00:00Z",
  "updated_at": "2026-11-25T10:00:00Z"
}

A file larger than 25 MB returns 413.

The first file on a cluster adds a small persistent folder to the Keycloak pods, which takes one restart. By default the restart waits for the cluster’s maintenance window, and the file shows waiting_for_restart until then.

To restart straight away, send apply_now as a plain-text form field:

curl -X POST "https://api.skycloak.io/clusters/$CLUSTER_ID/password-blacklist-files" \
  -H "API-Key: $SKYCLOAK_API_KEY" \
  -H "API-Version: 2026-06-01.beta" \
  -F "name=common-passwords.txt" \
  -F "apply_now=true" \
  -F "file=@common-passwords.txt;type=text/plain"

apply_now only matters for the first file, or while an earlier file is still waiting for the restart. Later files on a cluster that already has the folder need no restart. If applying now is not available for the cluster, the request returns 422 with an error naming apply_now; upload without it and the restart runs in the maintenance window.

curl "https://api.skycloak.io/clusters/$CLUSTER_ID/password-blacklist-files" \
  -H "API-Key: $SKYCLOAK_API_KEY" \
  -H "API-Version: 2026-06-01.beta"

Get a single file with GET /clusters/{cluster_id}/password-blacklist-files/{name}.

status is one of:

Status Meaning
waiting_for_restart Stored, and waiting for the restart that adds the folder.
delivering The folder exists and the file is being copied to it.
ready The copy on the cluster matches sha256. The file can be used in a realm password policy.
failed Delivery failed. Delete the file and upload it again under the same name, or contact support if it fails again.

Wait for ready before you set the realm policy.

Uploading a file does not turn anything on. Once the file is ready, add the passwordBlacklist policy to each realm that should use it, with the file name in brackets:

  1. Open the realm in the Keycloak admin console.
  2. Go to Authentication, then Policies, then Password policy.
  3. Add the Password Blacklist policy (passwordBlacklist) and enter the file name, for example common-passwords.txt.
  4. Save.

The policy is then passwordBlacklist(common-passwords.txt), and Keycloak rejects any new password that appears in the file. The file stays in place across pod restarts.

A delete is refused while a realm password policy on the cluster still names the file. Remove the file from every realm’s password policy first, then delete it:

curl -X DELETE "https://api.skycloak.io/clusters/$CLUSTER_ID/password-blacklist-files/common-passwords.txt" \
  -H "API-Key: $SKYCLOAK_API_KEY" \
  -H "API-Version: 2026-06-01.beta"

The response is 204. Deleting a cluster deletes its files.

Status When
403 The cluster is a shared trial realm, or the key lacks the scope.
404 The cluster or the file does not exist.
409 The name already exists on the cluster, the cluster is being deleted, or a delete is refused because a realm password policy still names the file.
413 The file is larger than 25 MB.
422 The name is invalid, the file is empty, the cluster already has 10 files, or apply_now is not available.

Errors follow the format described in Errors.