Skip to content

Document SAML identity provider metadata key cache settings - #55329

Open
SaintNick1214 wants to merge 1 commit into
keycloak:mainfrom
SaintNick1214:issue-54974
Open

SaintNick1214 wants to merge 1 commit into
keycloak:mainfrom
SaintNick1214:issue-54974

Conversation

@SaintNick1214

Copy link
Copy Markdown

Closes #54974

The guidance is a new subsection of the SAML v2.0 identity provider topic that the "Use metadata descriptor URL" row links to, rather than more text in the table cell. The cell is already long, and this file keeps longer explanations (SP descriptor, subject confirmation, ProxyRestriction) in anchored subsections. The existing sentences of the cell are unchanged.

The text uses the option names as an administrator sets them and as the All provider configuration guide lists them (spi-public-key-storage--infinispan--min-time-between-requests, spi-public-key-storage--infinispan--max-cache-time) instead of the Java property names, and links to that guide with the existing {allproviderconfigguide_link} attribute.

The described behaviour is that of InfinispanPublicKeyStorageProvider and SamlAbstractMetadataPublicKeyLoader on main. Three points are spelled out because they are easy to assume differently: maxCacheTime is only consulted when all keys are requested and the descriptor has no cacheDuration or validUntil, so a cached key that a message identifies is used without a time-based refresh; an expiration from the descriptor replaces maxCacheTime in both directions; the minimum interval is counted per identity provider and per node from the download that produced the cached keys, and it also applies to the "Reload keys" action.

Metadata signature validation, entity ID matching and the SAML client topic (which has a similar sentence) are left out because they are non-goals of the issue. The provider option descriptions are unchanged; they are consistent with the new text. If #54971 changes when a key miss triggers a download, this section needs a matching update in that change.

Verified by building the documentation guides locally (the build fails on Asciidoctor warnings) and running GuideTest. ExternalLinksTest was not run locally. The less obvious statements were also confirmed with a throwaway unit test against InfinispanPublicKeyStorageProvider that is not part of this PR.

An AI coding agent (Claude Code) was used to produce this change from a prompt, including the checks against the source code described above.

🤖 Generated with Claude Code

Describe when keys loaded from the metadata descriptor URL are
downloaded again, how the public-key-storage options
minTimeBetweenRequests and maxCacheTime interact with cacheDuration and
validUntil in the descriptor, and the trade-offs of changing these
options.

Closes keycloak#54974

Signed-off-by: Nicholas Geil <63267399+SaintNick1214@users.noreply.github.com>
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
@SaintNick1214
SaintNick1214 marked this pull request as ready for review November 19, 2026 00:06
@SaintNick1214
SaintNick1214 requested a review from a team as a code owner November 19, 2026 00:06
Copilot AI balanced review requested due to automatic review settings November 19, 2026 00:06

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.

🟡 Changes recommended

The documentation incorrectly promises an immediate retry when no key hint is present, overlooking that a cached empty key list delays downloading until expiration or maxCacheTime.

1 open issue
What changed in this PR

This documentation-only PR adds SAML identity-provider metadata cache guidance to help administrators balance key freshness against metadata endpoint traffic, addressing #54974 without changing runtime behavior.

Changes:

  • Adds an anchored subsection linked from “Use metadata descriptor URL.”
  • Explains refresh triggers, cache settings, metadata expiration, and security and operational trade-offs.
  • Includes a configuration example and links to the All provider configuration guide.
File Description
docs/​documentation/​server_admin/​topics/​identity-broker/​saml.adoc Adds metadata key-cache guidance and a link from the existing settings table.

Review effort: Balanced

Comment on lines +127 to +128
A node downloads the descriptor when it validates a signature and its cache has no keys for the identity provider.
A node that has cached keys downloads the descriptor again in the following situations:
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 security implications of SAML identity-provider metadata cache settings

3 participants