GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: propagate #1809 to `oauth.Credentials` by mikeedjones · Pull Request #1875 · googleapis/google-auth-library-python

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@mikeedjones

@mikeedjones mikeedjones commented Nov 20, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Fixes #1850

#1809 changed _refresh_token on auth.Credentials but not oauth2.Credentials which are used interchangeably in other google SKDs. This PR propagates the same changes as in #1809 to oauth.Credentials

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikeedjones
mikeedjones requested review from a team November 20, 2025 13:15
@mikeedjones mikeedjones changed the title fix: propagate https://github.com/googleapis/google-auth-library-python/pull/1809 to oath.Credentials fix: propagate #1809 to oath.Credentials Nov 21, 2025
@mikeedjones mikeedjones changed the title fix: propagate #1809 to oath.Credentials fix: propagate #1809 to oauth.Credentials Nov 21, 2025
mikeedjones added 2 commits November 23, 2025 11:35
@mikeedjones
fix: rename internal refresh token attribute to _refresh_token_val an…
a283a5b
…d add _refresh_token wrapper

Rename the stored refresh token attribute from _refresh_token to _refresh_token_val to avoid a name collision with a newly added _refresh_token(request) wrapper that delegates to refresh(request). Update all references and tests accordingly to match changes in fix test_aws_based_external_account system test

Fixes googleapis#1850
@mikeedjones
fix occasion when _refresh_token being treated like the old attribu…
bec5843
…te, as opposed to a methdo
@mikeedjones
mikeedjones force-pushed the bugfix/propagate-change-of-refresh-token-to-oauth-credentials branch from a5b9161 to bec5843 Compare November 23, 2025 11:35
@mikeedjones
mikeedjones requested a review from a team November 23, 2025 11:35
mikeedjones
mikeedjones commented Nov 23, 2025
View reviewed changes
Comment thread google/auth/external_account_authorized_user.py
)
self.token = None
self._refresh_token = None
self._refresh_token_val = None

@mikeedjones mikeedjones Nov 23, 2025

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I think this and the associated test was missed in #1809

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikeedjones mikeedjones mentioned this pull request Dec 4, 2025
[2.42.0] Bug with impersonated account token refresh #1850
Closed
iostreamdoth
iostreamdoth reviewed Dec 4, 2025
View reviewed changes
Comment thread google/oauth2/credentials.py
def _metric_header_for_usage(self):
return metrics.CRED_TYPE_USER

def _refresh_token(self, request):

@iostreamdoth iostreamdoth Dec 4, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

why not remove this and revert change on.

self._source_credentials._refresh_token(request) - > self._source_credentials.refresh(request)

I think using refresh() makes sense in place of _refresh_token

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mikeedjones mikeedjones Dec 5, 2025

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

_refresh_token has to be a method - _source_credentials._refresh_token. being called from google\auth\impersonated_credentials.py is causing #1850.

There is a bigger fix where "private" methods/attributes of source_credentials are not accessed, but that would be a much larger and more complicated change. This PR is only trying to align the interfaces of oauth2.credentials and auth.credentials since that was not done in #1809

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mikeedjones mikeedjones Dec 10, 2025

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Apparently not! #1884

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikeedjones
Merge branch 'main' into bugfix/propagate-change-of-refresh-token-to-…
0f52925
…oauth-credentials
@mikeedjones mikeedjones closed this Dec 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@iostreamdoth iostreamdoth iostreamdoth left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[2.42.0] Bug with impersonated account token refresh

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mikeedjones @iostreamdoth
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 01402775 — 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.