File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
google/auth/compute_engine Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 1+ # example for getting the default credentials
2+ import google .auth
3+ import google .auth .transport .requests
4+
5+ cred , project = google .auth .default (scopes = ["email" ]) # create an object, but it doesn't token yet
6+
7+ print (cred )
8+ print (project )
9+
10+ req = google .auth .transport .requests .Request () # create a http object for http calls
11+ cred .refresh (req ) # call refresh to fetch a token
12+
13+ print (cred .token )
14+ print (cred .expiry )
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ def _retrieve_info(self, request):
100100 request , service_account = self ._service_account_email
101101 )
102102
103+ import pdb ; pdb .set_trace ()
103104 # Don't override scopes requested by the user.
104105 if self ._scopes is None :
105106 self ._scopes = info ["scopes" ]
You can’t perform that action at this time.
0 commit comments