Skip to contents

Login to the EDI repository

Usage

login(userId = NULL, userPass = NULL, config = NULL)

Arguments

userId

(character) User identifier of an EDI data repository account. If using

userPass

(character) Password of userId

config

(character) Path to config.txt, which contains userId and userPass (see details below)

Value

(character) A temporary (~10 hour) authentication token written to the system variable "EDI_TOKEN".

Details

If userId, userPass, and config are NULL, the console will prompt for credentials.

config: Supplying credentials in a file named config.txt facilitates authentication within automated/unassisted processes. Contents of this file should be new line separated and have the form "<argument> = <value>" (e.g. userId = myname).

Note

Only works when authenticating with EDI credentials. Does not work when authenticating with ORCiD, GitHub, or Google credentials.

Be careful not to accidentally share your userId and userPass. Some tips to avoid this:

  • Don't write code that explicitly lists your credentials.

  • Don't save your workspace when exiting an R session.

  • Do store your credentials as environmental variables and reference these.

  • Do use config but if using version control ensure the config.txt file is listed in your .gitignore.

If you may have shared your credentials, please reset your password at https://dashboard.edirepository.org/dashboard/auth/reset_password_init.

See also

Other Authentication: logout()

Examples

if (FALSE) {

# Interactively at the console
login()
#> User name: "my_name"
#> User password: "my_secret"

# Programmatically with function arguments
login(userId = "my_name", userPass = "my_secret")

# Programmatically with a file containing userId and userPass arguments
login(config = paste0(tempdir(), "/config.txt"))
}