i am accessing user data by connecting to bigquery via python with OAuth 2.0 method. But every time I make a query, it repeatedly asks for browser confirmation. How can I cancel this verification? When I set the launch_browser value to False, it requests confirmation from the terminal. Is there a different method I can use? I am using the same sample code found in the document https://cloud.google.com/bigquery/docs/authentication/end-user-installed
from google_auth_oauthlib import flow
from google.cloud import bigquery
launch_browser = True
appflow = flow.InstalledAppFlow.from_client_secrets_file(
"client_secrets.json", scopes=["https://www.googleapis.com/auth/bigquery"]
)
if launch_browser:
appflow.run_local_server()
else:
appflow.run_console()
credentials = appflow.credentials
project = 'user-project-id'
client = bigquery.Client(project=project, credentials=credentials)
query_string = """SELECT name, SUM(number) as total
FROM `bigquery-public-data.usa_names.usa_1910_current`
WHERE name = 'William'
GROUP BY name;
"""
query_job = client.query(query_string)
for row in query_job.result():
print("{}: {}".format(row["name"], row["total"]))