Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating pseudo OOB auth from DIY client #263

Closed
meztez opened this issue Jun 12, 2023 · 3 comments · Fixed by #264
Closed

Creating pseudo OOB auth from DIY client #263

meztez opened this issue Jun 12, 2023 · 3 comments · Fixed by #264

Comments

@meztez
Copy link

meztez commented Jun 12, 2023

Running

library(bigrquery)
bigrquery::bq_auth_configure(path = "extraw.json") #this function is obfuscated in internal data of package
gargle::cred_funs_set(list("credentials_user_oauth2" = gargle::cred_funs_list()$credentials_user_oauth2))

bigrquery::bq_auth(use_oob = TRUE)
con <- DBI::dbConnect(
  bigrquery::bigquery(),
  project = {project},
  dataset = {dataset},
  billing = {project},
  bigint = "numeric",
  quiet = FALSE
)

We hit Erreur 400 : redirect_uri_mismatch

We tracked it down to :

params$oob_value <- select_pseudo_oob_value(client$redirect_uris)

there is something funky going on client_type and client$type, so params$oob_value end up null and not working.

We will replicate the function for now, until we can propose a better fix.

@jennybc
Copy link
Member

jennybc commented Jun 14, 2023

Yeah I have found (and fixed) a bug in gargle 1.5.0. I'm doing some more checks to make sure I've got it right this time, then will do a patch release ASAP.

@jennybc
Copy link
Member

jennybc commented Jun 14, 2023

I can't really release gargle until June 17, because I need to wait a week after the v1.5.0 release. But in the meantime, you could roll back to v1.4.0 or install the dev version. If you install the dev version, I'd love to hear confirmation that everything is fixed for you.

@meztez
Copy link
Author

meztez commented Jun 16, 2023

Sorry I did not share. We already had a workaround for bigrquery auth in place. Thanks for looking this up.

oauthfunction <- function (scopes = NULL, client = app, package = "gargle", ..., app = NULL) {
  gargle::gargle2.0_token(client = client, scope = scopes, package = package, app = client, ...)
}
gargle::cred_funs_set(list("credentials_user_oauth2" = oauthfunction))

@jennybc I've tested with 1.5.0.9000, the issue is gone. Auth works as expected. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants