Skip to content

Carry over id_token in refresh_token response - #103

Merged
kilork merged 2 commits into
masterfrom
fix-100-refresh-id-token
Oct 4, 2026
Merged

kilork merged 2 commits into
masterfrom
fix-100-refresh-id-token

Conversation

@kilork

@kilork kilork commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Fixes #100

Client::refresh_token already carried over the refresh_token when the authorization server omits it from the refresh response (RFC 6749, section 10.4). The same handling is now applied to id_token: OIDC providers (e.g. QuickBooks per the issue) may omit it, and OIDC Core 1.0 section 12.2 explicitly allows the refreshed response to not contain an id_token — the client should then retain the previous one. Without this, the refreshed bearer can no longer be used for decode_token/request_userinfo.

  • extracted the carry-over logic into a small sync helper (carry_over_missing) so it can be unit-tested without an HTTP runtime
  • values returned by the authorization server always win; only missing fields fall back to the previous token
  • ensure_token routes through the same code path, so it is covered too

Authorization servers may omit the id_token in a refresh response
(OpenID Connect Core 1.0, section 12.2). Keep the previous id_token so
the refreshed bearer stays usable for decode and request_userinfo,
matching the existing refresh_token carry-over (RFC 6749, section 10.4).

Fixes #100
@kilork
kilork merged commit fad73c1 into master Oct 4, 2026
3 of 4 checks passed
@kilork
kilork deleted the fix-100-refresh-id-token branch October 4, 2026 19:30
@wt

wt commented Oct 5, 2026

Copy link
Copy Markdown

This rules. Thanks.

@kilork

kilork commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

This rules. Thanks.

Thanks for reporting this!

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.

refresh token drops the id token part of the token

2 participants