fix(mcp): log OAuth refresh failure diagnostics on auth-loss - #1969
Merged
Aaronontheweb merged 3 commits intoAug 17, 2026
Merged
Conversation
When a stored OAuth record can no longer produce a working access token, SDK 2.0's refresh path fails silently: a refresh is only attempted when the cached token container matches the live provider on all four binding fields (AuthorizationServer, ClientId, ClientSecret, TokenEndpointAuthMethod), and even then the raw refresh HTTP response is swallowed (returned null, surfaced as the generic 'null authorization result'). The opaque failure made nightly Jira PR reviews undiagnosable. Report exactly which binding field is missing/mismatched, whether a refresh token existed to redeem, access-token expiry, and dynamic-registration state whenever an auth failure demotes a server to AwaitingAuth or AuthFailed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a stored OAuth record can no longer produce a working access token, SDK 2.0's refresh path fails silently. Refresh is only attempted when the cached token container matches the live provider on all four binding fields — AuthorizationServer, ClientId, ClientSecret, TokenEndpointAuthMethod — and even then the raw refresh HTTP response is swallowed (returned null, surfaced as the generic
null authorization result). The opaque failure made the recurring Atlassian MCP nightly Jira PR review failures undiagnosable.Change
Report exactly which binding field is missing/mismatched, whether a refresh token existed to redeem, access-token expiry, and dynamic-registration state whenever an auth failure demotes a server to AwaitingAuth or AuthFailed (catalog refresh + connection paths).
Companion root-cause PR: #1970 (persist SDK-resolved client identity).