1818import argparse
1919
2020
21+ # [START auth_api_implicit]
2122def implicit (project ):
2223 import googleapiclient .discovery
2324
@@ -28,8 +29,10 @@ def implicit(project):
2829 # Make an authenticated API request
2930 buckets = storage_client .buckets ().list (project = project ).execute ()
3031 print (buckets )
32+ # [END auth_api_implicit]
3133
3234
35+ # [START auth_api_explicit]
3336def explicit (project ):
3437 from google .oauth2 import service_account
3538 import googleapiclient .discovery
@@ -46,8 +49,10 @@ def explicit(project):
4649 # Make an authenticated API request
4750 buckets = storage_client .buckets ().list (project = project ).execute ()
4851 print (buckets )
52+ # [END auth_api_explicit]
4953
5054
55+ # [START auth_api_explicit_compute_engine]
5156def explicit_compute_engine (project ):
5257 from google .auth import compute_engine
5358 import googleapiclient .discovery
@@ -63,8 +68,10 @@ def explicit_compute_engine(project):
6368 # Make an authenticated API request
6469 buckets = storage_client .buckets ().list (project = project ).execute ()
6570 print (buckets )
71+ # [END auth_api_explicit_compute_engine]
6672
6773
74+ # [START auth_api_explicit_app_engine]
6875def explicit_app_engine (project ):
6976 from google .auth import app_engine
7077 import googleapiclient .discovery
@@ -80,6 +87,7 @@ def explicit_app_engine(project):
8087 # Make an authenticated API request
8188 buckets = storage_client .buckets ().list (project = project ).execute ()
8289 print (buckets )
90+ # [END auth_api_explicit_app_engine]
8391
8492
8593if __name__ == '__main__' :
0 commit comments