GoogleGenomics (version 1.4.2)

authenticate: Configure how to authenticate for Google Genomics API.


Follow the sign up instructions at to download the client secrets file, or note the clientId and clientSecret pair.


authenticate(file, clientId, clientSecret, invokeBrowser, apiKey)


Client secrets file obtained from Google Developer Console. This file could be for a native application or a service account. If this file is not present, clientId and clientSecret must be provided for native application credentials. Service account support needs version 0.1-2 or greater of PKI.
Client ID from Google Developer Console, overridden if file is provided.
Client Secret from Google Developer Console, overridden if file is provided.
If TRUE or not provided, the default browser is invoked with the auth URL iff the httpuv package is installed (suggested). If FALSE, a URL is output which needs to be copy pasted in a browser, and the resulting token needs to be pasted back into the R session. With both the options, you will still need to login to your Google account if not logged in already.
Public API key that can be used to call the Genomics API for public datasets. This method of authentication does not need you to login to your Google account. Providing this key overrides all other arguments.


NULL (silently) if successful.


apiKey <- Sys.getenv("GOOGLE_API_KEY")
if (! && nchar(apiKey)>0) {
## Not run: 
# authenticate(file="clientSecrets.json")
# authenticate(file="clientSecrets.json", invokeBrowser=FALSE)
# authenticate(clientId="abc", clientSecret="xyz", invokeBrowser=FALSE)
# ## End(Not run)