These functions let you create a service JSON key from an OAuth2 login. You can then assign it roles and do a one time download of a service account key to use for authentication in other Google APIs
gar_service_create( accountId, projectId, serviceName ="googleAuthR::gar_service_create", serviceDescription ="A service account created via googleAuthR")gar_service_grant_roles( accountIds, roles, projectId, type = c("serviceAccount","user","group"))gar_service_get_roles( projectId, accountId =NULL, type = c("serviceAccount","user","group"))gar_service_key( accountId, projectId, file = paste0(accountId,"-auth-key.json"))gar_service_key_list(accountId, projectId)gar_service_list(projectId)gar_service_get(accountId, projectId)
Arguments
accountId: The service accountId
projectId: The projectId containing the service account
serviceName: Name of service account
serviceDescription: Description of service account
accountIds: A vector of accountIds in the form accountId@projectid.iam.gserviceaccount.com