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

Feature: Using with service accounts #16

Open
sebble opened this issue Oct 28, 2020 · 0 comments
Open

Feature: Using with service accounts #16

sebble opened this issue Oct 28, 2020 · 0 comments

Comments

@sebble
Copy link

sebble commented Oct 28, 2020

I don't see a mechanism to authenticate (and impersonate) with service accounts using gcalendr alone. This was not too hard by using gargle, but is bypassing the internal .auth variable and may lead to inconsistent results.

My code is like:

impersonation_token = function(email, path) {
  cred <- gargle::credentials_service_account(
    scopes = c(
      "https://www.googleapis.com/auth/calendar.readonly",
      "https://www.googleapis.com/auth/calendar.events.readonly"),
    path = path,
    subject = email
  )
  return(httr::config(token = cred))
}

gcalendr::calendar_events(.., token = impersonation_token(..))

The gargle documentation kindly suggests that it is "a reasonable feature request" to expose the subject property through your gcalendr_auth method, but I realise this is perhaps non-trivial.

So consider this a feature request/discussion, and if I can help, please advise.

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

No branches or pull requests

1 participant