GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — fix: preserve existing refresh_token when server omits it in refresh response · Pull Request #2304 · modelcontextprotocol/python-sdk ConversationProblem
After the first successful refresh, Per RFC 6749 Section 6, issuing a new refresh token in the refresh response is optional. Many OAuth providers omit it by default (Google, Auth0 without rotation enabled, Okta in persistent token mode). FixBefore overwriting if ( not token_response.refresh_token and self.context.current_tokens and self.context.current_tokens.refresh_token ): token_response = token_response.model_copy( update={"refresh_token": self.context.current_tokens.refresh_token} ) This matches the RFC wording: if a new refresh token is issued, replace the old one; otherwise keep using the existing one. Fixes #2270
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…response Per RFC 6749 Section 6, the authorization server MAY issue a new refresh token in the refresh response. When it does not, the client must preserve the existing one. The current implementation replaces current_tokens with the parsed response as-is, which discards the stored refresh_token when the server omits it. After the first successful refresh, can_refresh_token() returns False and all subsequent refreshes fail, forcing full re-authentication. Many OAuth providers omit refresh_token from refresh responses by default (Google, Auth0 without rotation, Okta in persistent mode). Github-Issue: #2270
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. _handle_refresh_response discards existing refresh_token when server omits itUh oh!
There was an error while loading. Please reload this page. 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. | |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |