authenticate: Authenticate against gen3.theanvil.io

Description Usage Arguments Details Value Examples

View source: R/authenticate.R

Description

Authenticate against gen3.theanvil.io using credentials obtained external to R. Authentication persis for the duration of the R session, or until authentication expires using criteria defined on the server.

Usage

1

Arguments

file

character(1) or NULL. If character(1), file path to json credentials, as described in the 'details' section.

Details

To obtain credentials for direct access to Gen3, visit https://gen3.theanvil.io, login, and click on the profile icon. There you can create an access credential as a JSON file. Download this file and remember its location. Do not share this file with others. A convenient location to store the credentials file is at this location:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
    cache <- tools::R_user_dir("Gen3", "cache")
    credentials <- file.path(cache, "credentials.json")

To use with an AnVIL account, log in to
https://anvil.terra.bio, select the 'Profile' item on the
'HAMBURGER' dropdown, and use 'NHGRI AnVIL Data Commons
Framework Services' to link AnVIL with your Gen3 account. When
on the AnVIL platform, or with the `gcloud` binary on your
search path and with `AnVIL::gcloud_cmd("auth", "list")`
incidating the correct account for AnVIL access, gain access to
Gen3 with no arguments, `authenticate()`.

Value

The bearer token used for authentication, invisibly

Examples

1
2
3
4
5
## Authenticate first
cache <- tools::R_user_dir("Gen3", "cache")
credentials <- file.path(cache, "credentials.json")
if (file.exists(credentials))
    authenticate(credentials)

Bioconductor/Gen3 documentation built on Aug. 13, 2020, 4:13 p.m.