I'm building a shiny app to connect to big query and return info on projects, datasets and tables in a big query account. I'm also using the bigrquery package and would like to know how to force it to ask for authentication.
Right now, once I run load the bigrquery package and run bq_projects(). I am able to see all my projects. I believe this is because while working on a previous dbt project, I enabled Local Oauth gcloud setup via gcloud CLI
You can use the
googleAuthRlibrary for this use case.You will find a couple of examples on how to implement them in this document.
Here are other resources that you can reference for technical insights.
R/bq-auth.R
R/credentials_gce.R
R/oauth-cache.R
Authorization for accessing BigQuery from R session on server