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

Gaia id not found for email x #197

Open
MarkEdmondson1234 opened this issue Dec 1, 2020 · 2 comments
Open

Gaia id not found for email x #197

MarkEdmondson1234 opened this issue Dec 1, 2020 · 2 comments
Assignees
Labels

Comments

@MarkEdmondson1234
Copy link
Owner

When using gar_service_provision() the email is not created (for example with googleAnalyticsR::gar_auth_setup() if it doesn't exist.

The check to see if the email is already there fails but does not create an email. The error message it looks for is no longer "x does not exist"

@MarkEdmondson1234
Copy link
Owner Author

They did change the error message - this needs to be more robust, do it on a 404 not error message.
Its changed from "Not found" to "Unknown service account"

In gar_service_create() :

o <- tryCatch(
    gar_service_get(candidate, projectId = projectId), 
    error = function(err){

         # watch out if they update the error message #197
         need_one <- grepl(paste("Not found"), err$message)
      ...

@MarkEdmondson1234
Copy link
Owner Author

MarkEdmondson1234 commented Nov 16, 2021

This is fixed now

library(googleAuthR)
projectId <- gar_set_client(Sys.getenv("GAR_CLIENT_JSON"), scopes = "https://www.googleapis.com/auth/cloud-platform")
✓ Setting client.id from /Users/mark/xxx.json

gar_auth()
The googleAuthR package is requesting access to your Google account.
Select a pre-authorised account or enter '0' to obtain a new token.
Press Esc/Ctrl + C to cancel.

1: me@work.com

Selection: 1

gar_service_create("candidate", projectId = "xxx")
ℹ 2021-11-16 16:36:16 > Request Status Code:  4042021-11-16 16:36:16 > Creating new service account:  candidate@xxx.iam.gserviceaccount.com2021-11-16 16:36:16 > Creating service accountId -  candidate
$name
[1] "projects/xxx/serviceAccounts/[email protected]"

$projectId
[1] "xxx"

$uniqueId
[1] "104025210063389158565"

$email
[1] "[email protected]"

$displayName
[1] "googleAuthR::gar_service_create"

$etag
[1] "MDEwMjE5MjA="

$description
[1] "A service account created via googleAuthR"

$oauth2ClientId
[1] "104025210063389158565"

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

No branches or pull requests

1 participant