Skip to content

Append .well-known/openid-configuration to iss claim URL upfront#47

Closed
mikehaas763 wants to merge 3 commits intoDuendeSoftware:mainfrom
mikehaas763:copilot/update-jwt-prefill-logic
Closed

Append .well-known/openid-configuration to iss claim URL upfront#47
mikehaas763 wants to merge 3 commits intoDuendeSoftware:mainfrom
mikehaas763:copilot/update-jwt-prefill-logic

Conversation

@mikehaas763
Copy link
Copy Markdown

@mikehaas763 mikehaas763 commented Feb 20, 2026

DISCLOSURE: I had copilot do this for me

When a JWT is pasted, the decoder auto-populates the URI field with the bare iss claim value and immediately fetches it. This fails with "Error loading JWKs: Failed to fetch" since the issuer URL (e.g. https://demo.duendesoftware.com) isn't a JWKs or discovery endpoint.

Instead of adding retry/fallback logic in fetchJwks(), just append /.well-known/openid-configuration to the iss value upfront — we know it's an issuer identifier, not a JWKs endpoint.

  • Append discovery path to iss value in attemptSignatureValidation() before passing to loadJwks()
  • Extract appendDiscoveryPath() helper, reused by the existing non-JSON content type retry path
- jwksUrl = payload.iss;
+ jwksUrl = appendDiscoveryPath(payload.iss);

JWT Decoder with discovery URL appended upfront

Copilot AI and others added 3 commits February 20, 2026 02:20
… issuer URLs by retrying with discovery document path

Co-authored-by: mikehaas763 <2096573+mikehaas763@users.noreply.github.com>
… fallback retries

Co-authored-by: mikehaas763 <2096573+mikehaas763@users.noreply.github.com>
@maartenba maartenba requested a review from wcabus February 20, 2026 19:59
@maartenba
Copy link
Copy Markdown
Member

@wcabus can you look into this?

Copy link
Copy Markdown
Member

@wcabus wcabus left a comment

Choose a reason for hiding this comment

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

LGTM!

@wcabus wcabus self-assigned this Feb 20, 2026
@wcabus wcabus added the enhancement New feature or request label Feb 20, 2026
@wcabus
Copy link
Copy Markdown
Member

wcabus commented Feb 20, 2026

Had to create another PR #48 to make our actions run, but thanks @mikehaas763 for this fix!

@wcabus wcabus closed this Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants