opalr (version 1.2.0)

opal.login: Opal login

Description

Log in Opal(s).

Usage

opal.login(username = getOption("opal.username"),
  password = getOption("opal.password"),
  token = getOption("opal.token"), url = getOption("opal.url"),
  opts = getOption("opal.opts", list()), restore = NULL)

Arguments

username

User name in opal(s). Can be provided by "opal.username" option.

password

User password in opal(s). Can be provided by "opal.password" option.

token

Personal access token (since opal 2.15). Only effective if the username or the password is NULL or empty. Can be provided by "opal.token" option.

url

Opal url or list of opal urls. Can be provided by "opal.url" option.

opts

Curl options as described by httr (call httr::httr_options() for details). Can be provided by "opal.opts" option.

restore

Workspace ID to be restored (see also opal.logout)

Value

A opal object or a list of opal objects.

See Also

Other connection functions: opal.logout

Examples

# NOT RUN {
#### The below examples illustrate the different ways to login in opal ####

# explicite username/password login
o <- opal.login(username='administrator', password='password', url='https://opal-demo.obiba.org')
opal.logout(o)

 # explicite personal access token login
o <- opal.login(token='HYG16LO0VaX4O0UardNbiqmr2ByBpRke', url='https://opal-demo.obiba.org')
opal.logout(o)

# login using options and user credentials
options(opal.username='administrator',
 opal.password='password',
 opal.url='https://opal-demo.obiba.org')
o <- opal.login()
opal.logout(o)

# login using options and personal access token
options(opal.token='HYG16LO0VaX4O0UardNbiqmr2ByBpRke',
 opal.url='https://opal-demo.obiba.org')
o <- opal.login()
opal.logout(o)

# login using ssl key pair
options(opal.opts=list(
   sslcert='my-publickey.pem',
   sslkey='my-privatekey.pem'))
o <- opal.login(url='https://opal-demo.obiba.org')
opal.logout(o)
# }