Skip to content

Omit ID tokens from token exchange error logs - #2100

Merged
lizkenyon merged 1 commit into
mainfrom
liz/redact-token-exchange-error-log
Nov 5, 2026
Merged

lizkenyon merged 1 commit into
mainfrom
liz/redact-token-exchange-error-log

Conversation

@lizkenyon

@lizkenyon lizkenyon commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Token-exchange failures currently write the full ID token to the error log. Keep the diagnostic message, but omit the token value.

The existing regression test now expects a token-free message and verifies that the same InvalidJwtTokenError is re-raised. Authentication, retry and redirect behavior are unchanged.

Related: Shopify/shopify-api-ruby#1481 makes another token-exchange rejection use this existing error path. This cleanup also applies to the failures that already reach it and does not depend on that PR.

Things to focus on

  • The error-level diagnostic remains useful without including the token.
  • The original exception is still propagated to the existing controller recovery handling.

Checklist

  • Update CHANGELOG.md if the changes would impact users
  • Follow the repository disclosure policy; public remediation confirmed before opening this PR

@lizkenyon
lizkenyon marked this pull request as ready for review November 5, 2026 19:51

@Suleimanlatrsh Suleimanlatrsh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good! Checked that nothing else logs the token.

@lizkenyon
lizkenyon merged commit 52bc948 into main Nov 5, 2026
7 checks passed
@lizkenyon
lizkenyon deleted the liz/redact-token-exchange-error-log branch November 5, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants