Skip to content

Incorrect auth server is used for credential offers#974

Merged
tnotheis merged 4 commits intorelease/openid4vcfrom
incorrect-auth-server-is-used-for-credential-offers
Feb 25, 2026
Merged

Incorrect auth server is used for credential offers#974
tnotheis merged 4 commits intorelease/openid4vcfrom
incorrect-auth-server-is-used-for-credential-offers

Conversation

@tnotheis
Copy link
Member

Readiness checklist

  • I added/updated tests.
  • I ensured that the PR title is good enough for the changelog.
  • I labeled the PR.
  • I self-reviewed the PR.

@tnotheis tnotheis requested review from britsta and erbenjak February 25, 2026 14:05
@tnotheis tnotheis self-assigned this Feb 25, 2026
Copilot AI review requested due to automatic review settings February 25, 2026 14:05
@tnotheis tnotheis added the bug Something isn't working label Feb 25, 2026
Copy link

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

This PR fixes an issue where the incorrect authorization server was being used for credential offers in the OpenID4VC flow. The code was previously using credentialOffer.metadata.authorizationServers[0].issuer (now removed), but has been changed to use credentialOffer.credentialOfferPayload.grants.authorization_code.authorization_server instead.

Changes:

  • Replaced the authorization server extraction logic to use the correct source from the credential offer payload's grants section
  • Added validation to check if the authorization server exists and show an appropriate error if it doesn't
  • Added a new error message for invalid credential offers

Reviewed changes

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

File Description
packages/app-runtime/src/AppStringProcessor.ts Updated authorization server extraction logic and added validation for missing authorization server in credential offers
packages/app-runtime/src/AppRuntimeErrors.ts Added new error message for invalid credential offers
Comments suppressed due to low confidence (1)

packages/app-runtime/src/AppStringProcessor.ts:103

  • The non-null assertion operators (!) are used on a chain that could potentially be undefined. While line 84 checks for grants?.authorization_code before calling this function, the non-null assertions on line 103 assume that grants, authorization_code, and authorization_server are all defined. However, the subsequent null check on line 104 suggests that authorization_server can be undefined, which makes the non-null assertion misleading. Consider removing the non-null assertion operator on authorization_server to accurately reflect that this value can be undefined, or use optional chaining instead.
        const authorizationServer = credentialOffer.credentialOfferPayload.grants!.authorization_code!.authorization_server!;

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

britsta
britsta previously approved these changes Feb 25, 2026
@tnotheis tnotheis merged commit 00dfc1f into release/openid4vc Feb 25, 2026
15 checks passed
@tnotheis tnotheis deleted the incorrect-auth-server-is-used-for-credential-offers branch February 25, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants