File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
google/auth/compute_engine Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -124,8 +124,9 @@ def refresh(self, request):
124124 scopes = self ._scopes if self ._scopes is not None else self ._default_scopes
125125 try :
126126 self ._retrieve_info (request )
127+ # Always fetch token with default service account email.
127128 self .token , self .expiry = _metadata .get_service_account_token (
128- request , service_account = self . _service_account_email , scopes = scopes
129+ request , service_account = "default" , scopes = scopes
129130 )
130131 except exceptions .TransportError as caught_exc :
131132 new_exc = exceptions .RefreshError (caught_exc )
Original file line number Diff line number Diff line change @@ -501,7 +501,7 @@ def test_with_target_audience_integration(self):
501501 responses .add (
502502 responses .GET ,
503503 "http://metadata.google.internal/computeMetadata/v1/instance/"
504- "service-accounts/service-account@example.com /token" ,
504+ "service-accounts/default /token" ,
505505 status = 200 ,
506506 content_type = "application/json" ,
507507 json = {
@@ -659,7 +659,7 @@ def test_with_quota_project_integration(self):
659659 responses .add (
660660 responses .GET ,
661661 "http://metadata.google.internal/computeMetadata/v1/instance/"
662- "service-accounts/service-account@example.com /token" ,
662+ "service-accounts/default /token" ,
663663 status = 200 ,
664664 content_type = "application/json" ,
665665 json = {
You can’t perform that action at this time.
0 commit comments