Skip to content

Add Password Policy SPI chapter to the Server Developer Guide - #50804

Merged
ahus1 merged 2 commits into
keycloak:mainfrom
enoquefcd:docs-password-policy-spi
Sep 25, 2026
Merged

ahus1 merged 2 commits into
keycloak:mainfrom
enoquefcd:docs-password-policy-spi

Conversation

@enoquefcd

Copy link
Copy Markdown
Contributor

Closes #50803

Adds a Password Policy SPI chapter to the Server Developer Guide. The guide documents the User Storage, Authentication, Action Token Handler, Event Listener, SAML Role Mappings and Vault SPIs, but had no material on password policies.

The chapter covers, in the structure of the existing SPI chapters:

  • Implementing PasswordPolicyProvider / PasswordPolicyProviderFactory, with a complete example.
  • The factory methods and their effect on the Admin Console.
  • parseConfig and configuration validation.
  • Shipping PolicyError messages and the passwordPoliciesHelp.<id> tooltip key from the provider JAR through theme-resources/messages.
  • Registration and deployment.

The chapter is inside the project_community conditional, like the other community-only SPI chapters. ./mvnw clean install -pl docs/documentation/server_development -am -Pdocumentation builds clean and the chapter renders in the generated guide.

AI disclosure

Generative AI (Claude) was used to assist with drafting the chapter and this description, per the contributing guidelines. I have reviewed and verified every statement against the current sources and will personally address review feedback.

@enoquefcd
enoquefcd requested a review from a team as a code owner July 11, 2026 00:27
Copilot AI balanced review requested due to automatic review settings July 11, 2026 00:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Password Policy SPI guidance to the Server Developer Guide.

Changes:

  • Documents provider implementation, configuration, localization, registration, and deployment.
  • Adds a worked custom password-policy example.
  • Includes the chapter in community documentation builds.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
topics/password-policy-spi.adoc Adds the Password Policy SPI chapter.
topics.adoc Includes the chapter in community builds.

Copilot AI review requested due to automatic review settings July 11, 2026 00:38
@enoquefcd
enoquefcd force-pushed the docs-password-policy-spi branch from ff2c28b to fbb24ea Compare July 11, 2026 00:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings July 11, 2026 00:44
@enoquefcd
enoquefcd force-pushed the docs-password-policy-spi branch from fbb24ea to 1c8d7f4 Compare July 11, 2026 00:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings July 23, 2026 11:01
@enoquefcd
enoquefcd force-pushed the docs-password-policy-spi branch from 2642cd7 to 41644db Compare July 23, 2026 11:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

docs/documentation/server_development/topics/password-policy-spi.adoc:155

  • The tooltip is loaded through the admin-messages bundle (AdminConsole.java:407-408), so adding this key to the previously recommended messages_en.properties leaves the raw key visible. Direct providers to use theme-resources/messages/admin-messages_en.properties (and corresponding locale files) for tooltip keys.
The Admin Console shows a tooltip for each policy row, resolved from the admin theme message key `passwordPoliciesHelp.<policy id>`. Ship the key from the provider JAR with the same `theme-resources/messages` mechanism used for error messages:

Copilot AI review requested due to automatic review settings July 23, 2026 11:13
@enoquefcd
enoquefcd force-pushed the docs-password-policy-spi branch from 41644db to a95f3ad Compare July 23, 2026 11:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@enoquefcd
enoquefcd force-pushed the docs-password-policy-spi branch from a95f3ad to bc44117 Compare August 20, 2026 16:19
Copilot AI review requested due to automatic review settings August 20, 2026 16:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

The guide covers every other commonly extended SPI but had no material
on password policies. The new chapter documents the provider and factory
interfaces, configuration parsing, error message keys, admin console
help text, and provider registration.

Closes keycloak#50803

Signed-off-by: Enoque Duarte <enoquefcd@gmail.com>
@ahus1
ahus1 force-pushed the docs-password-policy-spi branch from bc44117 to e5e4d6a Compare September 25, 2026 09:00
Copilot AI review requested due to automatic review settings September 25, 2026 09:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The blanket internal-SPI warning incorrectly encompasses the user-defined custom SPI documented in the extensions chapter.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

ahus1
ahus1 previously approved these changes Sep 25, 2026

@ahus1 ahus1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the change. Given that it is an internal SPI, I'm usually reluctant to add documentation about it. I've added a note to it.

In addition, I added blank lines to the topics.adoc between the includes, as this is a best practice to make it robust, as otherwise headings might miss the blank line in front of them once the includes are resolved.

@ahus1
ahus1 enabled auto-merge (squash) September 25, 2026 09:04
Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Copilot AI review requested due to automatic review settings September 25, 2026 09:04
@ahus1
ahus1 force-pushed the docs-password-policy-spi branch from e5e4d6a to 4a03a0d Compare September 25, 2026 09:04
@ahus1
ahus1 merged commit db9c28f into keycloak:main Sep 25, 2026
71 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The documentation accurately reflects the current SPI, Admin Console, policy parsing, and theme-resource behavior.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@enoquefcd
enoquefcd deleted the docs-password-policy-spi branch September 25, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document the Password Policy SPI in the Server Developer Guide

4 participants