You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a helper method for running an interactive installed app flow, similar to:
defcredentials_flow_interactive(client_secrets_file, scopes):
"""Initiate an interactive OAuth2InstalledApp flow. - Display a URL for the user to visit. - URL displays a code for the user to copy. - Wait on standard input for the user to enter the provided code. - Exchange OAuth2 tokens. Args: client_secrets_file: The path to the client secrets JSON file. scopes: The list of scopes to request during the flow. """flow=google.oauth2.flow.Flow.from_client_secrets_file(
client_secrets_file,
scopes=scopes,
redirect_uri='urn:ietf:wg:oauth:2.0:oob')
auth_url, _=flow.authorization_url(prompt='consent')
print('Please go to this URL: %s'%auth_url)
code=input('Enter the authorization code: ')
flow.fetch_token(code=code)
returnflow.credentials
The text was updated successfully, but these errors were encountered:
Create a helper method for running an interactive installed app flow, similar to:
The text was updated successfully, but these errors were encountered: