Skip to content

Fix jwt-auth module documentation bugs#4337

Open
janhoy wants to merge 3 commits intoapache:mainfrom
janhoy:feature/jwt-auth-docs
Open

Fix jwt-auth module documentation bugs#4337
janhoy wants to merge 3 commits intoapache:mainfrom
janhoy:feature/jwt-auth-docs

Conversation

@janhoy
Copy link
Copy Markdown
Contributor

@janhoy janhoy commented Apr 26, 2026

Several long-standing bugs were found in the JWT authentication plugin reference guide.

blockUnknown default was wrong since apache/lucene-solr#805 (SOLR-13649). That PR changed the documented default from false to true without touching the code, which has always used getOrDefault("blockUnknown", false). We decided to change the code default to true in #4373, so only cosmetic changes in this PR related to this config.

aud default was documented as "Uses clientId if configured". No such fallback exists in the code — when aud is not set, audience validation is skipped entirely.

adminUiScope fallback was documented as falling back to the first scope entry. A second fallback to the hardcoded string "solr" exists in the code but was not mentioned.

Clock-skew tolerance — a 30-second exp tolerance is applied by the plugin but was not documented. Added a note to the requireExp row.

Intent is to merge this to main and branch_10x. PS: The blockUnknown issue in 9.x will be fixed with a doc change: #4374

- blockUnknown default corrected from true to false throughout; the wrong
  default was introduced by apache/lucene-solr#805 (SOLR-13649), a docs-only
  change that never reflected the actual code (getOrDefault(..., false)).
  Intro paragraph, parameter table, and complex-example callout all fixed.
  blockUnknown:true restored in the JWKS URL and Admin UI examples that the
  same commit had removed, so production configs clearly show the recommended
  setting.
- aud default corrected: no clientId fallback exists; audience validation is
  skipped entirely when aud is not configured.
- adminUiScope: document the second fallback to the hardcoded string "solr".
- requireExp: document the 30-second clock-skew tolerance.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Apr 26, 2026
@janhoy janhoy requested a review from Copilot April 26, 2026 00:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Solr JWTAuthPlugin reference guide to correct several long-standing documentation inaccuracies around default behaviors and recommended production configuration.

Changes:

  • Correct blockUnknown default documentation to match code (false) and clarify enforcement guidance.
  • Fix documented behavior for aud (no fallback to clientId) and adminUiScope (includes "solr" fallback).
  • Document the plugin’s 30s clock-skew tolerance relevant to exp validation and update examples to explicitly set blockUnknown: true where appropriate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread solr/solr-ref-guide/modules/deployment-guide/pages/jwt-authentication-plugin.adoc Outdated
Comment thread solr/solr-ref-guide/modules/deployment-guide/pages/jwt-authentication-plugin.adoc Outdated
@janhoy janhoy requested review from dsmiley and gus-asf April 26, 2026 18:20
@janhoy
Copy link
Copy Markdown
Contributor Author

janhoy commented Apr 28, 2026

It was argued that for 10.x it is better to change the actual default to 'true' and keep the documentation as-is..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants