Skip to content

fix: jwk-set-cache related properties are not take effect#49356

Open
rujche wants to merge 14 commits into
mainfrom
rujche/main/fix-bug-about-jwk-cache
Open

fix: jwk-set-cache related properties are not take effect#49356
rujche wants to merge 14 commits into
mainfrom
rujche/main/fix-bug-about-jwk-cache

Conversation

@rujche
Copy link
Copy Markdown
Member

@rujche rujche commented Jun 3, 2026

Description

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings June 3, 2026 02:18
@rujche rujche requested review from a team, Netyyyy, moarychan and saragluna as code owners June 3, 2026 02:18
@rujche rujche self-assigned this Jun 3, 2026
@rujche rujche added bug This issue requires a change to an existing behavior in the product in order to be resolved. azure-spring All azure-spring related issues azure-spring-aad Spring active directory related issues. labels Jun 3, 2026
@rujche rujche moved this to In Progress in Spring Cloud Azure Jun 3, 2026
@rujche rujche added this to the 2026-06 milestone Jun 3, 2026
@rujche rujche changed the title Rujche/main/fix bug about jwk cache fix: jwk-set-cache related properties are not take effect Jun 3, 2026
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 Spring Cloud Azure AAD resource server JWT decoder construction so JWK retrieval uses a Nimbus JWKSource configured with the library’s cache-related properties, addressing the reported issue where JWK cache settings were not being honored.

Changes:

  • Switched AAD resource server NimbusJwtDecoder creation to use withJwkSource(...) and applied jwk-set-cache-* properties via JWKSourceBuilder.
  • Added/updated tests to assert the configured JWK cache durations and to continue validating HTTP timeout wiring.
  • Updated Spring module CHANGELOG entries (includes an entry that appears unrelated to this PR’s code changes).

Reviewed changes

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

File Description
sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/configuration/AadResourceServerConfiguration.java Build NimbusJwtDecoder from a Nimbus JWKSource configured with resource retrieval timeouts and JWK cache durations.
sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/aad/configuration/AadResourceServerConfigurationTests.java Added assertions verifying default/custom JWK cache durations and updated timeout verification to follow the new JWK source structure.
sdk/spring/CHANGELOG.md Added a JWK cache-related release note; also modified another bullet that appears unrelated to the PR’s scope.

Comment thread sdk/spring/CHANGELOG.md
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

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

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

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

@rujche
Copy link
Copy Markdown
Member Author

rujche commented Jun 3, 2026

/azp run java - spring - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@rujche
Copy link
Copy Markdown
Member Author

rujche commented Jun 3, 2026

@copilot resolve the merge conflicts in this pull request

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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

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

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

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

@rujche
Copy link
Copy Markdown
Member Author

rujche commented Jun 3, 2026

/azp run java - spring - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@rujche
Copy link
Copy Markdown
Member Author

rujche commented Jun 3, 2026

/azp run java - spring - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@rujche
Copy link
Copy Markdown
Member Author

rujche commented Jun 3, 2026

/azp run java - spring - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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

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

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

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

Comment thread sdk/spring/scripts/log.py
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

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

@rujche
Copy link
Copy Markdown
Member Author

rujche commented Jun 3, 2026

/azp run java - spring - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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

Labels

azure-spring All azure-spring related issues azure-spring-aad Spring active directory related issues. bug This issue requires a change to an existing behavior in the product in order to be resolved.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Add Support for JWK Cache Configuration in Resource Server

3 participants